From: Sam Joseph Date: 2006-02-08T23:18:28+09:00 Subject: Re: odd http header corruption Hi Eric, Eric Hodel wrote: > On Feb 6, 2006, at 1:16 AM, Sam Joseph wrote: > >> Hi there, >> >> I can't tell if this is a problem with the ruby cgi library or with >> rails action pack (no response from the rails list so far), but I >> get an >> occasional error in the http headers from rails like this: >> >> HTTP/1.x 200 OK >> Date: Thu, 02 Feb 2006 20:56:03 GMT >> Server: Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-16 mod_ruby/1.2.4 >> Ruby/1.8.4(2005-12-24) >> #<#:0x40b8e8d4>Content-Type: text/html >> Cache-Control: no-cache > > You're adding a metaclass thingy to your headers. Indeed - not intentionally I assure you :-) > >> Some kind of object data is getting dumped in front of the Content- >> Type, >> which screws up how some browsers display the page. >> >> Setting Content-Type explicitly in the controller doesn't seem to help, >> and so far I have been unable to detect what causes this, or why it >> happens under some circumstances and not others - I am posting this >> here >> in case anybody has seen something similar, or has ideas about possible >> causes. > > > Does it go away if you take that out? No > > I'm going to blame your code or Rails on this one. Or some interaction of the two :-) The thing I'm really keen to work out is how the actioncontroller cgi_process.rb generates the output before the odd thingy, i.e. HTTP/1.x 200 OK Date: Thu, 02 Feb 2006 20:56:03 GMT Server: Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-16 Since placing a newline before any output from CgiReponse.out places that new line after these three lines, so where are they generated? I can't work it out. Many thanks. CHEERS> SAM