1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Handle param-parsing errors from Rack in ExceptionWrapper

This commit is contained in:
Grey Baker 2015-04-02 11:40:34 +01:00
parent 22e39f8b65
commit 0a9b86b0c0
2 changed files with 9 additions and 1 deletions

View file

@ -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.

View file

@ -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