Re: FastCGI Programmer's Guide possible error.

Bryan White <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel,gmane.spam.detected
Message-ID <[email protected]>
Tom Wright wrote:
> Hi,
> 
> The FastCGI Programmer's Guide seems to have some errors in its C code
> examples. The line terminates used for specifying the content type are
> "\r\n" rather than "\n\r" - which is what I think they should be. See
> http://www.fastcgi.com/devkit/doc/fastcgi-prog-guide/ch2c.htm#5373 for
> details.
> 
> Certain browsers (e.g firefox) seem to ignore instructions terminated
> with "\r\n" resulting in the browser failing to recognize the
> mime-type served documents - this is rather confusing. It would be
> useful if this could be fixed so as to not confuse the unwary.

I have never seen \n\r used as a newline.

I think you have it backwards:

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2

Furthermore RFC3875 (The CGI Spec) seems to indicate the form of the 
newline in the headers is platform specific.  Oddly they don't list 
Windows as a platform but do list AmigaDOS, UNIX and EBCDIC/POSIX. 
Anyway, my reading is that servers should be prepared to accept either 
\r\n or \n.  I have always just used \n and had no complaints.  I should 
think FastCGI would be at least as robust as that because the 
application might be running natively on different box/architecture as 
the server.  A quick look at the FastCGI spec shows it is silent on the 
issue.

-- 
Bryan White


___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.