This project is archived and is in readonly mode.
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: http://rubyonrails.org?x=0&x[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 http://groups.google.com/group/r... 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
-
Adam Hooper May 6th, 2009 @ 04:35 PM
Attached: patch to not-crash when Rack::Request.GET or Rack::Request.POST return nil.
This does not fix the issue, but at least it lets Rails print out a nice stack trace. (I'm not entirely clear why.) I imagine that means it lets the "exception_notification" plugin work.
-
Adam Hooper May 6th, 2009 @ 05:01 PM
Patch which handles TypeError as well. This makes the 500 errors go away.
-
Adam Hooper May 6th, 2009 @ 05:03 PM
Monkey-patch which can be included in config/initializers on any Rails 2.3.2 app
-
xhming July 19th, 2010 @ 07:34 AM
- Importance changed from to
bags care replica handbags store stand for empitic dominion replica Jimmy Choo handbags sale a idiosyncrasy of colors replica Gucci Wallet sale again styles congruous to high quality replica handbags the play of wholesale replica Marc Jacobs handbags handbags for cheap replica handbags replica Street sale replica hadnbags online replica handbags
-
Santiago Pastorino February 2nd, 2011 @ 04:51 PM
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino February 2nd, 2011 @ 04:51 PM
- State changed from open to stale
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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
- Nobody is watching this ticket.