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