Mongrel 0.3.5 -- Rails/CGI Actually Works

This release of Mongrel features a CGIWrapper that actually works. The
previous code was complete garbage so this one should fix the problems
sessions, cookies, and content-types people reported previously.

There is also now a correctly built Win32 gem created by Luis L…
joined the Mongrel project and will be working on the Win32 specific
needed. His first thing is going to be a Mongrel service so you can
start/stop Mongrel like other web servers on Win32.

Grab the goods at

== What Is Mongrel

Mongrel is a fast HTTP library and server for Ruby that is intended for
hosting Ruby web applications of any kind using plain HTTP rather than
FastCGI or SCGI. It is framework agnostic and already supports Ruby On
Rails, Og+Nitro, and Camping frameworks.

== Changes for 0.3.5

  • More correct CGIWrapper that should work with all CGI parameters and
    additional ones you set as well as properly converting cookies.
  • Content-types and sessions should be fixed now.
  • Fix to DirHandler that caused it to not list directories if told to.

Win32 people will still have problems with CTRL-C not stopping mongrel,
Luis is tracking that down as part of his win32 service work.

== Getting Mongrel

You can get Mongrel via RubyGems just make sure you pick the win32 gem
you are on that platform. You can use the regular gem if you have your

For those not familiar with RubyGems refer to the Mongrel site for help
(it’s right on the front page).

== Toward 0.4

This release is getting closer to complete Ruby on Rails support. It
work well, but file upload/send will probably function very weirdly if

The next release will focus on getting the win32 service working and
enabling all the little things like file upload/send, built-in page
support, and other goodies. People running Rails should shoot me
requests along these lines.

Zed A. Shaw

hi Zed
Sorry to be the bearer of bad news.

The proxy issue is still ocurring, as is the “Wrong Content-type:”
error returned when using webservices (xmlrpc) with 0.3.5

FYI, I tried the web service request from a webrick and mongrel server
and they both interpreted the Wrong Content-type, so the problem is not
in the parsing of requests but the creation of responses, but maybe
that is totally obvious :slight_smile:

thanks for your efforts


Ok, let me look at the wrong content-type. Problem is that I have a
which sets the content type just fine, so I’m thinking that the WS stuff
must be doing something else.

The proxy stuff will still be broken until I can add a setting for “the

Zed A. Shaw

Ah yes, very clever stuff going on here in CGI land. Take a look at
dump of what is passed to the “head” method.

head: {}
options: {“Status”=>“200 OK”, “type”=>“text/xml”, “cookie”=>[],
“Cache-Control”=>“no-cache”, “X-Zed”=>“dabomb”}

head: {“Status”=>“200 OK”, “cookie”=>[], “Cache-Control”=>“no-cache”,
“Server”=>“Mongrel 0.3.5”, “Content-Type”=>“text/xml”,
options: “text/html”

It’s basically a problem with both the head() and out() methods
to “text/html” as their content type so it gets reset when the output is
sent on. If you change 629 of mongrel.rb to be:

    @head['Content-Type'] = options unless @head['Content-Type']

Then that will fix it. This also means that it will default to the
content-type set. I’ll pack that up into a fix for a release tomorrow
later tonight. Let me know if that works.

Proxy stuff coming soon.

Zed A. Shaw

nice one laddie!

works for me.

proxy fix and I’m all set :slight_smile: