rails: Invalid querystring leads to status 500 (TypeError: expected Hash (got Array) for param)
If a request contains an invalid querystring, Rails responds with a 500 - server error.
Eg: http://www.crunchbase.com/?foo[]=array&foo[hash]=hash
Rack Utils#normalize_params
expects the input to be a hash in this case, but foo[]=array looks like an array.
I’d expect: 400 Bad Request - The request could not be understood by the server due to malformed syntax.
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 21 (18 by maintainers)
Links to this issue
Commits related to this issue
- Fix a bug where malformed query strings lead to 500 If a request contains an malformed query string, Rails responds with an internal server error insted of a bad request. This is because ActionDispat... — committed to yuki24/rails by yuki24 10 years ago
- Fix a bug where malformed query strings lead to 500 If a request contains an malformed query string, Rails responds with an internal server error insted of a bad request. This is because ActionDispat... — committed to yuki24/rails by yuki24 10 years ago
- Fix a bug where malformed query strings lead to 500 If a request contains an malformed query string, Rails responds with an internal server error insted of a bad request. This is because ActionDispat... — committed to yuki24/rails by yuki24 10 years ago
- Fix a bug where malformed query strings lead to 500 If a request contains an malformed query string, Rails responds with an internal server error insted of a bad request. This is because ActionDispat... — committed to yuki24/rails by yuki24 10 years ago
- Capture ActionController::BadRequest before processing action * In Rails 4.2, request#formats never raises BadRequest * In Rails 4.1 and earlier, request#formats raises it for the first time,... — committed to yuki24/rambulance by yuki24 10 years ago
- Capture ActionController::BadRequest before processing action * In Rails 4.2, request#formats never raises BadRequest * In Rails 4.1 and earlier, request#formats raises it for the first time,... — committed to yuki24/rambulance by yuki24 10 years ago
Also found this error, the problem were with pickadate.js library. It’s adding additional field with name “…_submit” by default.