This project is archived and is in readonly mode.

#2611 ✓stale
Adam Hooper

Rack::Utils.parse_nested_query throws exceptions, leads to 500 errors on every Rails app

Reported by Adam Hooper | May 5th, 2009 @ 11:59 PM | in 3.x

On Rails 2.3.2:

Rack::Utils.parse_nested_query('x=0&x[y]=1') IndexError: string not matched

This leads to 500 errors on any Rails app. For instance:[y]=1

I would expect "x=0&x[y]=1" to generate params['x'] == { 'y' => '1' }. This would follow Rails's "form.checkbox()" convention, in which "?x=0&x=1" leads to params['x'] == '1'.

I'm quite opinionated about Rack's being the wrong place to do parameter parsing (see and the chutzpah Rack has to throw an exception in something as trivial as parameter parsing. (In Rack 1.0.0 the exception is accidental, but in git master it becomes explicit.)

Please stop my Rails app from generating 500 errors when users enter the wrong URL! (And, as a helpful bonus, please make "x=0&x[y]=1" generate params == "{ 'x' => { 'y' => '1' } }", so my app will work ;).)

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket