Sha256: 00e2a8e1fc65b48ec100bc067fff04ced62caef0ab4478a0261a8678e70be9a6

Contents?: true

Size: 711 Bytes

Versions: 45

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 { |k, v| v.blank? }
          super parameters
        end
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
doorkeeper-0.6.3 lib/doorkeeper/oauth/authorization/uri_builder.rb
doorkeeper-0.6.2 lib/doorkeeper/oauth/authorization/uri_builder.rb
doorkeeper-0.6.1 lib/doorkeeper/oauth/authorization/uri_builder.rb
doorkeeper-0.6.0 lib/doorkeeper/oauth/authorization/uri_builder.rb
doorkeeper-0.6.0.rc1 lib/doorkeeper/oauth/authorization/uri_builder.rb