mirror of https://github.com/rails/rails
Don't assume that invalid UTF-8 will raise an error.
Rack 3 parses the query part of a URL as ASCII-8BIT and does not fail on invalid UTF-8 code sequences. Limit the tests to Rack 2.
This commit is contained in:
parent
5b9a246013
commit
fd48e72518
|
@ -1129,19 +1129,21 @@ class RequestParameters < BaseRequestTest
|
|||
end
|
||||
end
|
||||
|
||||
test "parameters not accessible after rack parse error of invalid UTF8 character" do
|
||||
request = stub_request("QUERY_STRING" => "foo%81E=1")
|
||||
assert_raises(ActionController::BadRequest) { request.parameters }
|
||||
end
|
||||
if Rack.release < "3"
|
||||
test "parameters not accessible after rack parse error of invalid UTF8 character" do
|
||||
request = stub_request("QUERY_STRING" => "foo%81E=1")
|
||||
assert_raises(ActionController::BadRequest) { request.parameters }
|
||||
end
|
||||
|
||||
test "parameters containing an invalid UTF8 character" do
|
||||
request = stub_request("QUERY_STRING" => "foo=%81E")
|
||||
assert_raises(ActionController::BadRequest) { request.parameters }
|
||||
end
|
||||
test "parameters containing an invalid UTF8 character" do
|
||||
request = stub_request("QUERY_STRING" => "foo=%81E")
|
||||
assert_raises(ActionController::BadRequest) { request.parameters }
|
||||
end
|
||||
|
||||
test "parameters containing a deeply nested invalid UTF8 character" do
|
||||
request = stub_request("QUERY_STRING" => "foo[bar]=%81E")
|
||||
assert_raises(ActionController::BadRequest) { request.parameters }
|
||||
test "parameters containing a deeply nested invalid UTF8 character" do
|
||||
request = stub_request("QUERY_STRING" => "foo[bar]=%81E")
|
||||
assert_raises(ActionController::BadRequest) { request.parameters }
|
||||
end
|
||||
end
|
||||
|
||||
test "POST parameters containing invalid UTF8 character" do
|
||||
|
|
Loading…
Reference in New Issue