Skip to content

Commit

Permalink
Merge pull request #235 from yez/three
Browse files Browse the repository at this point in the history
Remove explicit query param sorting
  • Loading branch information
sporkmonger committed Jun 15, 2016
2 parents ca387e9 + 614f153 commit 97ec996
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -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
Expand Down
3 changes: 0 additions & 3 deletions lib/addressable/uri.rb
Expand Up @@ -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']]
Expand Down
5 changes: 3 additions & 2 deletions spec/addressable/uri_spec.rb
Expand Up @@ -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 " +
Expand Down

0 comments on commit 97ec996

Please sign in to comment.