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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message