Permalink
Browse files

Merge pull request #235 from yez/three

Remove explicit query param sorting
  • Loading branch information...
2 parents ca387e9 + 614f153 commit 97ec99611f0c2aab518c295721ee41ee1c099e87 @sporkmonger committed Jun 15, 2016
Showing with 6 additions and 5 deletions.
  1. +3 −0 CHANGELOG.md
  2. +0 −3 lib/addressable/uri.rb
  3. +3 −2 spec/addressable/uri_spec.rb
View
@@ -1,3 +1,6 @@
+# Addressable 3.0
+- removed default query param sorting
+
# Addressable 2.3.2
- added Addressable::URI#default_port method
- fixed issue with Marshalling Unicode data on Windows
View
@@ -1607,9 +1607,6 @@ def query_values=(new_query_values)
key = key.to_s if key.kind_of?(Symbol)
[key, value]
end
- # Useful default for OAuth and caching.
- # Only to be used for non-Array inputs. Arrays should preserve order.
- new_query_values.sort!
end
# new_query_values have form [['key1', 'value1'], ['key2', 'value2']]
@@ -5696,9 +5696,10 @@ def to_str
@uri.query.should == nil
end
- it "should correctly sort {'ab' => 'c', :ab => 'a', :a => 'x'}" do
+ it "maintains original ordering: {'ab' => 'c', :ab => 'a', :a => 'x'}" do
@uri.query_values = {'ab' => 'c', :ab => 'a', :a => 'x'}
- @uri.query.should == "a=x&ab=a&ab=c"
+
+ @uri.query.should == "ab=c&ab=a&a=x"
end
it "should correctly assign " +

0 comments on commit 97ec996

Please sign in to comment.