Mongrel Bug

Josh Ferguson
Tue, 30 May 2006 05:33:51 -0000

Mongrel''s tempfile generation on
win32 is broken meaning large files can''t be uploaded.

On line 198 of mongrel.rb
(0.13.3) HttpRequest#initialize the tempfile function is called:

      if clen &gt; Const::MAX_BODY

        @body Tempfile.new(self.class.name)

        @body.binmode

      else

Unfortunately this also
includes the module name as the example shows:

Mongrel::HttpRequest2496.9

Win32 doesn''t allow the '':'' character in file names
so this fails.

I just solved the problem by replacing

self.class.name

with

self.class.name.split(''::'').last

Cheers,

Josh Ferguson