[Mongrel] Mongrel and http 1.1 OPTIONS keyword

Kirk Haines wyhaines at gmail.com
Tue Dec 11 12:50:34 EST 2007

On Dec 10, 2007 11:38 AM, Yves D'Astous <yves.dastous at intertrade.com> wrote:

> Does mongrel (which is the http server) is supposed to deal with these
> kind of request ?

Mongrel is the HTTP server, but _Mongrel_ itself should not be dealing
with OPTIONS reqests.

Mongrel doesn't know what the correct answer is for a given request
because the responsibility for handling a request falls onto the
shoulders of some handler or other.

In the case of a handler like DirHandler, which itself directly
handles the request, it would make sense for the handler to return the
response because the handler knows what is reasonable for a given

However, in the case of a handler like the RailsHandler, where the
handler just passes control to another entity (the application), that
entity is the only thing that can return a meaningful response to an
OPTIONS request -- the handler doesn't know what the application is
willing to handle for a given request.

I think that the value in changing the standard Mongrel handlers, like
DirHandler, to deal with OPTIONS is meager, at best, though.  As easy
as it is in Ruby to either subclass or just reopen a class and change
parts of it, I'd suggest that if one really _needs_ to do something
like handle OPTIONS, that they just create a custom handler for their
application which will do so in a way that makes sense for them.  And
if your Rails app really needs to handle OPTIONS, can't you just do

Kirk Haines

More information about the Mongrel-users mailing list