Skip to content
Browse files

removed parsing of quoted values

Signed-off-by: raggi <jftucker@gmail.com>
  • Loading branch information...
1 parent e6ebd83 commit 6fa19e3a268c05e24907ffe1b344b2323f1361ed @thinkerbot thinkerbot committed with raggi
Showing with 2 additions and 8 deletions.
  1. +0 −6 lib/rack/utils.rb
  2. +2 −2 test/spec_rack_utils.rb
View
6 lib/rack/utils.rb
@@ -38,9 +38,6 @@ def parse_query(qs, d = nil)
(qs || '').split(d ? /[#{d}] */n : DEFAULT_SEP).each do |p|
k, v = p.split('=', 2).map { |x| unescape(x) }
- if v =~ /^("|')(.*)\1$/
- v = $2.gsub('\\'+$1, $1)
- end
if cur = params[k]
if cur.class == Array
params[k] << v
@@ -69,9 +66,6 @@ def parse_nested_query(qs, d = nil)
module_function :parse_nested_query
def normalize_params(params, name, v = nil)
- if v and v =~ /^("|')(.*)\1$/
- v = $2.gsub('\\'+$1, $1)
- end
name =~ %r(\A[\[\]]*([^\[\]]+)\]*)
k = $1 || ''
after = $' || ''
View
4 test/spec_rack_utils.rb
@@ -33,7 +33,7 @@
Rack::Utils.parse_query("foo=bar").
should.equal "foo" => "bar"
Rack::Utils.parse_query("foo=\"bar\"").
- should.equal "foo" => "bar"
+ should.equal "foo" => "\"bar\""
Rack::Utils.parse_query("foo=bar&foo=quux").
should.equal "foo" => ["bar", "quux"]
Rack::Utils.parse_query("foo=1&bar=2").
@@ -51,7 +51,7 @@
Rack::Utils.parse_nested_query("foo=bar").
should.equal "foo" => "bar"
Rack::Utils.parse_nested_query("foo=\"bar\"").
- should.equal "foo" => "bar"
+ should.equal "foo" => "\"bar\""
Rack::Utils.parse_nested_query("foo=bar&foo=quux").
should.equal "foo" => "quux"

0 comments on commit 6fa19e3

Please sign in to comment.
Something went wrong with that request. Please try again.