Interesting Things
We discovered a bug in the load order of CGI extensions in ActionController in Rails 2.3.3. The body of the first request to a Mongrel server after loading the Rails environment will appear empty, even if it’s not. The problem is the default CGI::QueryExtension#initialize_query in the Ruby standard library will read the stdinput stream and not rewind it. As a result, future reads of stdinput look empty. In Rails, this behavior is overridden in action_controller/cgi_ext/query_extension.rb. Unfortunately this file isn’t loaded until after the first request to a new server, at which point subsequent requests work normally. The Rails ticket is here.
The easiest fix is to require “action_controller/cgi_ext” in your environment file or an initializer file.