From: Eric Hodel Date: 2006-02-09T14:05:03+09:00 Subject: Re: odd http header corruption On Feb 8, 2006, at 6:18 AM, Sam Joseph wrote: > Eric Hodel wrote: > >> On Feb 6, 2006, at 1:16 AM, Sam Joseph wrote: >> >>> 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. They are generated by Apache. What do you get when you run dispatch.cgi from the command line? -- Eric Hodel - drbrain@segment7.net - http://segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com