mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Test that ActionDispatch::IntegrationTest does not leak parameters
This commit is contained in:
parent
407583478a
commit
273a691dfd
1 changed files with 14 additions and 0 deletions
|
@ -625,6 +625,20 @@ class IntegrationProcessTest < ActionDispatch::IntegrationTest
|
|||
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'
|
||||
|
|
Loading…
Reference in a new issue