提交 273a691d 编写于 作者: N Nick Sieger

Test that ActionDispatch::IntegrationTest does not leak parameters

上级 40758347
......@@ -625,6 +625,20 @@ def test_get_with_parameters
end
end
def test_post_then_get_with_parameters_do_not_leak_across_requests
with_test_route_set do
post '/post', params: { leaks: "does-leak?" }
get '/get_with_params', params: { foo: "bar" }
assert request.env['rack.input'].string.empty?
assert_equal 'foo=bar', request.env["QUERY_STRING"]
assert_equal 'foo=bar', request.query_string
assert_equal 'bar', request.parameters['foo']
assert request.parameters['leaks'].nil?
end
end
def test_head
with_test_route_set do
head '/get'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册