This project is archived and is in readonly mode.
Bad Content Type Error in Rack 1.0 with first CGI Mongrel Request
-
Brad Sumersford
It appears as http://github.com/rack/rack/commit/95f068e84b90fdfd6440314b0f86862a... takes care of the issue by calling .rewind on the input before trying to parse it. Packaged gem for ActionPack 2.3.2 (w/ Rack 1.0.0) as of June 26th 2009 didn't appear to have this fix, today it does.
-
Brad Sumersford
It appears as though I was incorrect, the current version on rubyforge does not include the rewind fix. I had to perform wizardry beyond specifying remote and clearing my cache to prevent gems from installing the version I built from source (which does work).
-
Yehuda Katz (wycats)
Does this still happen on 2-3-stable? It appears that Josh vendered the latest rack with the following commit: http://github.com/rails/rails/commit/25fde77674cd6f9906b7a8e7eef046...
-
Yehuda Katz (wycats)
- State changed from new to open
-
Brad Sumersford
After checking out 2-3-stable is does look like the vendor/ directory includes the rack-1.0.x version which does include the rewind addition that addresses the above issue. The packaged gem still does not include this however (last time I checked), in the mean time I was able to successfully solve the issue by installing the rack gem (1.0.0) which also includes the fix.
Though this issue has been fixed (in 2-3-stable) the behaviour of the first request routing through the original CGI code and all subsequent requests routing through the Rails CGI code could still result in all sorts of weird and wonderful behaviours.
-
scott stewart
I'm seeing a painful variation on this with Rails right through 2.3.3. When mongrel is started via mongrel_cluster, and the first request to a newly started mongrel is a "POST", no request parameters or session is set inside the controller.
Once the restarted mongrel had handled its first request, all is well.
I've repeated this with a freshly created Rails app, adding a single controller and form. In my case this is just a regular Form (application/x-www-form-urlencoded ) and not a multi-part.
To repeat:
Start up mongrel_cluster of at least 1 mongrel.
Serve up a page with a form.
Restart mongrel_cluster.
Post form.Notice no session data or form parameters in controller.
-
Michael Koziarski
- Tag set to bugmash
-
Ryan Carmelo Briones
The scenario outlined by Scott Stewart happened to my coworkers and I today on the first deployment of our app after an upgrade from vendored 2.0.2 to vendored 2.3.4. FYI. Will see if I can come up with some kind of patch...
-
Ryan Carmelo Briones
http://gist.github.com/195369 is the interim fix that I've come up with to handle my issue as it relates to this ticket. It basically adds back the code that caused this scenario to break. The other possible fix that has worked for me was to add "cgi.stdinput.rewind" after L25 here (http://github.com/rails/rails/blob/2-3-stable/actionpack/lib/action...) but I don't fully understand the implications, and I'm not sure where to start adding a test that is related to the dispatcher but confirms that params were parsed in the proper way. Of course, I assume this will all be moot since .dispatch and .dispatch_cgi will probably go away in Rails 3.0.
-
Frederick Cheung
This commit appears to have fixed it for me: http://github.com/rails/rails/commit/6f2c4991efbbc5f567a6df36ca78de...
-
Rohit Arondekar
- State changed from open to resolved
- Importance changed from to