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)

Commits related to this issue

Most upvoted comments

Also found this error, the problem were with pickadate.js library. It’s adding additional field with name “…_submit” by default.

grid[filter_updated_at_from]:13.02.14
grid[filter_updated_at_from]_submit:2014/02/13