From: Eric Hodel Date: 2006-02-12T16:18:26+09:00 Subject: Re: odd http header corruption On Feb 9, 2006, at 9:48 AM, Sam Joseph wrote: > Eric Hodel wrote: > >> On Feb 8, 2006, at 6:18 AM, Sam Joseph wrote: >> >>> 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. > > Ah that makes sense. > >> What do you get when you run dispatch.cgi from the command line? > > I get: > > Status: 500 Internal Server Error > > The only operational code I see in dispatch.cgi is > Dispatcher.dispatch - I guess that's just passing the incoming > request to the appropriate controller. I guess you're saying that > Apache prints the first three lines, and then appends the rest of > the output from rails. But presumably the status code needs to be > communicated from rails to Apache - do you know how this happens? It is part of the CGI "spec". > That makes sense now. I guess it would be nice to be able to call > dispatch.cgi from the command line passing in the appropriate > parameters to see exactly what it spits back ... I tried the > following: > > ./dispatch.cgi /discussions/tree/1 > Status: 500 Internal Server Error > > so it's not as simple as that. You need to set up the complete request environment first. Things like REQUEST_METHOD and PATH_INFO and so-forth. -- Eric Hodel - drbrain@segment7.net - http://segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com