Class: Addressable::URI

Inherits:
Object
  • Object
show all
Defined in:
lib/faraday_middleware/addressable_patch.rb

Overview

fix ‘normalized_query` by sorting query key-value pairs (rejected: github.com/sporkmonger/addressable/issues/28)

Instance Method Summary collapse

Instance Method Details

#normalized_queryObject



10
11
12
13
14
15
16
17
18
# File 'lib/faraday_middleware/addressable_patch.rb', line 10

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

#normalized_query_without_ordering_fixObject



8
# File 'lib/faraday_middleware/addressable_patch.rb', line 8

alias normalized_query_without_ordering_fix normalized_query