diff options
author | Matthew Draper <matthew@trebex.net> | 2015-06-13 08:20:55 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2015-06-13 08:20:55 +0930 |
commit | 335a2b8a40d6f1553a76328fd89fc90a93d8d234 (patch) | |
tree | d39bf2245a4e8a2a113a8c57cab8c10ef6bb6e53 /actionpack | |
parent | 22e39f8b658c5823411f93f86f35acfd0eb226cd (diff) | |
parent | 0a9b86b0c096d67d22f597d4ef187853b7d210e6 (diff) | |
download | rails-335a2b8a40d6f1553a76328fd89fc90a93d8d234.tar.gz rails-335a2b8a40d6f1553a76328fd89fc90a93d8d234.tar.bz2 rails-335a2b8a40d6f1553a76328fd89fc90a93d8d234.zip |
Merge pull request #19632 from greysteil/reorder-middleware
Handle param-parsing errors from Rack that happen low down the stack
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG.md | 6 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/exception_wrapper.rb | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 7b2f150c67..78ae506389 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,9 @@ +* Adds`Rack::Utils::ParameterTypeError` and `Rack::Utils::InvalidParameterError` + to the rescue_responses hash in `ExceptionWrapper` (Rack recommends + integrators serve 400s for both of these). + + *Grey Baker* + * Add support for API only apps. ActionController::API is added as a replacement of ActionController::Base for this kind of applications. diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb index d176a73633..8c3d45584d 100644 --- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb @@ -17,7 +17,9 @@ module ActionDispatch 'ActionController::InvalidCrossOriginRequest' => :unprocessable_entity, 'ActionDispatch::ParamsParser::ParseError' => :bad_request, 'ActionController::BadRequest' => :bad_request, - 'ActionController::ParameterMissing' => :bad_request + 'ActionController::ParameterMissing' => :bad_request, + 'Rack::Utils::ParameterTypeError' => :bad_request, + 'Rack::Utils::InvalidParameterError' => :bad_request ) cattr_accessor :rescue_templates |