BUG: quote escaping destroys text (with spec patch)

1 view
Skip to first unread message

Andreas S.

unread,
Jun 6, 2010, 7:11:59 AM6/6/10
to Rack Development
SPEC:

diff --git a/test/spec_rack_request.rb b/test/spec_rack_request.rb
index 43a4b87..cfda3a1 100644
--- a/test/spec_rack_request.rb
+++ b/test/spec_rack_request.rb
@@ -555,4 +555,12 @@ EOF
req2.params.should.equal "foo" => "#{b}bar#{b}"
end
}
+
+ specify "should not remove text containing quotes" do
+ url = "/?foo=" + CGI.escape("bar\n\"baz\"")
+ env = Rack::MockRequest.env_for(url)
+ req = Rack::Request.new(env)
+ req.GET.should.equal "foo" => "bar\n\"baz\""
+ req.params.should.equal "foo" => "bar\n\"baz\""
+ end
end


RESULT:
3) Failure:
test_spec {Rack::Request} 129 [should not remove text containing
quotes](Rack::Request) [./test/spec_rack_request.rb:563]:
<{"foo"=>"bar\n\"baz\""}> expected but was
<{"foo"=>"baz"}>.

Simon Chiang

unread,
Jun 7, 2010, 10:45:26 AM6/7/10
to Rack Development

Michael Fellinger

unread,
Jun 7, 2010, 10:02:48 PM6/7/10
to rack-...@googlegroups.com
OK, I applied the patch from bahuvrihi, will update the bug trackers.

--
Michael Fellinger
CTO, The Rubyists, LLC

Reply all
Reply to author
Forward
0 new messages