Sha256: 848303a9d02b0d73d30128d8041110040e018cb18cf331fbabb19a57e22e6fb1

Contents?: true

Size: 621 Bytes

Versions: 24

Compression:

Stored size: 621 Bytes

Contents

require 'addressable/uri'

# feature-detect the bug
unless Addressable::URI.parse('/?a=1&b=2') === '/?b=2&a=1'
  # fix `normalized_query` by sorting query key-value pairs
  # (rejected: https://github.com/sporkmonger/addressable/issues/28)
  class Addressable::URI
    alias normalized_query_without_ordering_fix normalized_query

    def normalized_query
      fresh = @normalized_query.nil?
      query = normalized_query_without_ordering_fix
      if query && fresh
        @normalized_query = query.split('&', -1).sort_by {|q| q[0..(q.index('=')||-1)] }.join('&')
      else
        query
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 4 rubygems

Version Path
faraday_middleware-0.12.2 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.12.0 lib/faraday_middleware/addressable_patch.rb
faraday_middleware_safeyaml-0.12.pre.safeyaml lib/faraday_middleware/addressable_patch.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/faraday_middleware-0.11.0.1/lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.11.0.1 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.10.1 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.10.0 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.9.2 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.9.1 lib/faraday_middleware/addressable_patch.rb
agiley-faraday_middleware-0.9.1 lib/faraday_middleware/addressable_patch.rb
agiley-faraday_middleware-0.9.0 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.9.0 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.8.8 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.8.7 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.8.6 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.8.5 lib/faraday_middleware/addressable_patch.rb
agiley-faraday_middleware-0.8.3.2 lib/faraday_middleware/addressable_patch.rb
agiley-faraday_middleware-0.8.3.1 lib/faraday_middleware/addressable_patch.rb
faraday_middleware-0.8.4 lib/faraday_middleware/addressable_patch.rb
agiley-faraday_middleware-0.8.3 lib/faraday_middleware/addressable_patch.rb