|
134 | 134 | req.params.should.equal "foo" => "bar", "quux" => "bla" |
135 | 135 | end |
136 | 136 |
|
137 | | - should "not truncate query strings containing semi-colons #543" do |
138 | | - req = Rack::Request.new(Rack::MockRequest.env_for("/?foo=bar&quux=b;la")) |
139 | | - req.query_string.should.equal "foo=bar&quux=b;la" |
140 | | - req.GET.should.equal "foo" => "bar", "quux" => "b;la" |
141 | | - req.POST.should.be.empty |
142 | | - req.params.should.equal "foo" => "bar", "quux" => "b;la" |
| 137 | + should "not truncate query strings containing semi-colons #543 only in POST" do |
| 138 | + mr = Rack::MockRequest.env_for("/", |
| 139 | + "REQUEST_METHOD" => 'POST', |
| 140 | + :input => "foo=bar&quux=b;la") |
| 141 | + req = Rack::Request.new mr |
| 142 | + req.query_string.should.equal "" |
| 143 | + req.GET.should.be.empty |
| 144 | + req.POST.should.equal "foo" => "bar", "quux" => "b;la" |
| 145 | + req.params.should.equal req.GET.merge(req.POST) |
143 | 146 | end |
144 | 147 |
|
| 148 | + should "use semi-colons as separators for query strings in GET" do |
| 149 | + req = Rack::Request.new(Rack::MockRequest.env_for("/?foo=bar&quux=b;la;wun=duh")) |
| 150 | + req.query_string.should.equal "foo=bar&quux=b;la;wun=duh" |
| 151 | + req.GET.should.equal "foo" => "bar", "quux" => "b", "la" => nil, "wun" => "duh" |
| 152 | + req.POST.should.be.empty |
| 153 | + req.params.should.equal "foo" => "bar", "quux" => "b", "la" => nil, "wun" => "duh" |
| 154 | + end |
| 155 | + |
145 | 156 | should "limit the keys from the GET query string" do |
146 | 157 | env = Rack::MockRequest.env_for("/?foo=bar") |
147 | 158 |
|
|
0 commit comments