Sha256: 147d2b5bf421bca4ebf86bf6ceb85a3b9a2cb2abfc840526a97ce89e2530ad50

Contents?: true

Size: 711 Bytes

Versions: 4

Compression:

Stored size: 711 Bytes

Contents

module Doorkeeper
  module OAuth
    module Authorization
      module URIBuilder
        include Rack::Utils

        extend self

        def uri_with_query(url, parameters = {})
          uri            = URI.parse(url)
          original_query = parse_query(uri.query)
          uri.query      = build_query(original_query.merge(parameters))
          uri.to_s
        end

        def uri_with_fragment(url, parameters = {})
          uri = URI.parse(url)
          uri.fragment = build_query(parameters)
          uri.to_s
        end

        def build_query(parameters = {})
          parameters = parameters.reject { |_, v| v.blank? }
          super parameters
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
doorkeeper-4.2.0 lib/doorkeeper/oauth/authorization/uri_builder.rb
doorkeeper-4.1.0 lib/doorkeeper/oauth/authorization/uri_builder.rb
doorkeeper-4.0.0 lib/doorkeeper/oauth/authorization/uri_builder.rb
doorkeeper-4.0.0.rc4 lib/doorkeeper/oauth/authorization/uri_builder.rb