[Mongrel] Upload Size Limiting Handler

douglas sellers douglas.sellers at gmail.com
Tue Sep 19 14:16:30 EDT 2006

I have written a mongrel handler that monitors the content length of a given
url's request and redirects them if they are over a certain limit. The idea
is to throttle the maximum size of an uploaded file.

Using the process method on HttpHandlerPlugin I am able to make this work
the only downside is that the whole file is still uploaded.  I would much
prefer to inspect the http header params on the request_begins call and
inform mongrel that there is no need to process that request any more.  Is
there any way to do this?  I have glanced through both the handlers.rb and
mongrel.rb source and I don't think that it is possible.  While you can
inspect the http header params in the request_begins there is no way to
affect the actual processing of the request until the process method is

Does anyone have any suggestions as to how I may be able to work around
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060919/6ef8d69a/attachment.html 

More information about the Mongrel-users mailing list