in reply to Re^3: Debugging without shell access?
in thread Debugging without shell access?
His code is perfectly valid ... for HTTP/0.9, running under some webservers.
Except that the HTTP level has nothing at all to do with it. The CGI specification says that the Content-type, Location and Status are server directives; that is, they are used to communicate information back to the server. It's up to the server to create compliant HTTP messages. That's why you don't have to include a status line in your CGI program - the server will make sure there is one in the HTTP message.
It's important to realize that CGI programs do not talk HTTP, they talk CGI. HTTP for communication between a browser and a web server, CGI is for communication between a web server and a back-end program. Granted, most headers are passed as-is into the HTTP message (this is a feature), but the content-type is first interpreted by the server.
I've just re-read the HTTP/1.1 specs, and I can't find any mention of Content-Type being required.
From the RFC:
Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, th +e recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify th +e resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Debugging without shell access?
by jhourcle (Prior) on Oct 31, 2006 at 16:04 UTC |