diff options
-rw-r--r-- | lib/rack/utils.rb | 2 | ||||
-rw-r--r-- | test/spec_rack_utils.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb index 40f9b492..2d1ddc59 100644 --- a/lib/rack/utils.rb +++ b/lib/rack/utils.rb @@ -37,7 +37,7 @@ module Rack params = {} (qs || '').split(d ? /[#{d}] */n : DEFAULT_SEP).each do |p| - k, v = unescape(p).split('=', 2) + k, v = p.split('=', 2).map { |x| unescape(x) } if cur = params[k] if cur.class == Array diff --git a/test/spec_rack_utils.rb b/test/spec_rack_utils.rb index 8f4fd758..7dd5880e 100644 --- a/test/spec_rack_utils.rb +++ b/test/spec_rack_utils.rb @@ -28,6 +28,7 @@ context "Rack::Utils" do should.equal "foo" => "1", "bar" => "2" Rack::Utils.parse_query("my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F"). should.equal "my weird field" => "q1!2\"'w$5&7/z8)?" + Rack::Utils.parse_query("foo%3Dbaz=bar").should.equal "foo=baz" => "bar" end specify "should parse nested query strings correctly" do |