diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2019-05-07 12:19:42 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2019-05-07 15:14:14 -0400 |
commit | d155f61b64e7cecc56fe6281d084e1b12a0a3584 (patch) | |
tree | af546f7fb3d7dfe9d511a26ae823203a5857d704 /railties | |
parent | 68dc8c450067ff83455e1997c9330088cfce5fa0 (diff) | |
download | rails-d155f61b64e7cecc56fe6281d084e1b12a0a3584.tar.gz rails-d155f61b64e7cecc56fe6281d084e1b12a0a3584.tar.bz2 rails-d155f61b64e7cecc56fe6281d084e1b12a0a3584.zip |
Merge pull request #36196 from st0012/fix-29947
Hide malformed parameters from error page
Accidentally merged this to 6-0-stable so forward porting it to master
here instead.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/middleware/exceptions_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/application/middleware/exceptions_test.rb b/railties/test/application/middleware/exceptions_test.rb index 17df78ed4e..5fae521937 100644 --- a/railties/test/application/middleware/exceptions_test.rb +++ b/railties/test/application/middleware/exceptions_test.rb @@ -136,5 +136,21 @@ module ApplicationTests assert_match(/boooom/, last_response.body) assert_match(/測試テスト시험/, last_response.body) end + + test "displays diagnostics message when malformed query parameters are provided" do + controller :foo, <<-RUBY + class FooController < ActionController::Base + def index + end + end + RUBY + + app.config.action_dispatch.show_exceptions = true + app.config.consider_all_requests_local = true + + get "/foo?x[y]=1&x[y][][w]=2" + assert_equal 400, last_response.status + assert_match "Invalid query parameters", last_response.body + end end end |