This project is archived and is in readonly mode.

Bug in Chromium with GET parameters when doing a POST request
Reported by Damien MATHIEU | January 28th, 2010 @ 08:54 AM | in 3.0.2
With jQuery, I do some ajax requests in POST. As of now, some
parameters were given in GET (that's not good. But that was
historical).
So I made the request with the following :
jQuery.ajax({
    url: '/my/url?param=test',
    type: 'post'
});
In Firefox 3.5, this call works well. But in Chromium, rails raises an exception when trying to parse the parameters.
Error occurred while parsing request parameters.
Contents:
undefined
/!\ FAILSAFE /!\  28/01/2010 09:47:38
  Status: 500 Internal Server Error
  undefined method `name' for nil:NilClass
    /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in `method_missing'
    /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/xml_mini/rexml.rb:29:in `merge_element!'
    /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/xml_mini/rexml.rb:18:in `parse'
    /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/xml_mini.rb:12:in `__send__'
    /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/xml_mini.rb:12:in `parse'
    /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/hash/conversions.rb:164:in `from_xml'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:34:in `parse_formatted_parameters'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:11:in `call'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
    /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
This bug can be corrected by not passing the parameters in GET anymore.
jQuery.ajax({
    url: '/my/url',
    type: 'post',
    data: {
        param: 'test'
    }
});
I don't really know yet if this must be corrected in Chromium, jQuery or rails.
Comments and changes to this ticket
- 
            
         Joe None February 13th, 2010 @ 05:36 PMWas having the exact same problem, thanks for posting this. Seems like jQuery shouldn't allow a call like this to happen, in my opinion. 
- 
            
         Stefan Siebel February 20th, 2010 @ 06:39 PMI was getting the same error message, however the root cause seemed to be another one. My URL looked like /my/url?locale=en. But when I removed the URL param I still got the same error. 
 It turned out that I was adding a parameter twice. Once by serializing the form and the second time by calling$(document).ajaxSend(function(event, request, settings) { settings.data = { someParam: "somevalue" }; });After removing these three lines things started working in Google Chrome. 
- 
            
         Damien MATHIEU March 3rd, 2010 @ 09:21 AMbump ! This belongs in fact to jQuery. Not rails. Could someone close this ticket please ? 
 http://dev.jquery.com/ticket/5123it also appears if the data is undefined. We should then set it to null. 
- 
            
         Erik St. Martin March 19th, 2010 @ 02:04 AM- Tag changed from chromium, javascript, jquery, params to chromium, invalid, javascript, jquery, params
 
- 
         Yehuda Katz (wycats) March 27th, 2010 @ 08:30 AM- State changed from new to open
- Tag changed from chromium, invalid, javascript, jquery, params to chromium, javascript, jquery, rails3
- Assigned user set to Yehuda Katz (wycats)
- Milestone cleared.
 This is in fact a jQuery problem, but the Rails error could use some improvement (in general, failsafe errors mean that Rails didn't catch something it should have) 
- 
         Repository March 29th, 2010 @ 07:21 AM- State changed from open to resolved
 (from [48c1d8c341e1fe09111424131f7d223ad032b7e1]) Provide a better error if the parsed REXML document has no root [#3803 state:resolved] http://github.com/rails/rails/commit/48c1d8c341e1fe09111424131f7d22... 
- 
         Jeremy Kemper October 15th, 2010 @ 11:01 PM- Milestone set to 3.0.2
- Importance changed from  to Low
 
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
Tags
Referenced by
- 
         3803 
          Bug in Chromium with GET parameters when doing a POST request
        (from [48c1d8c341e1fe09111424131f7d223ad032b7e1])
Provide... 3803 
          Bug in Chromium with GET parameters when doing a POST request
        (from [48c1d8c341e1fe09111424131f7d223ad032b7e1])
Provide...
 Damien MATHIEU
      Damien MATHIEU
 Julien Sanchez
      Julien Sanchez
 Yehuda Katz (wycats)
      Yehuda Katz (wycats)