On Jan 25, 2004, at 0:05, Stas Bekman wrote:

Ged Haywood wrote:
Hello there,
On Sat, 24 Jan 2004, semuel wrote:
you don't need to "\r\n\r\n". "\n\n" will do the job.
According to the standard you should send both \r and \n.
It is bad practice to play fast and loose with standards.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html

Not if you use Apache. It does the right thing with "\n\n" for you, because it parses your headers and strips "\n\n" anyway, adding other HTTP headers and terminating each with "\r\n".

Looks like handling "\n" is required in CGI 1.1[*] if the script is not using NPH:


* On the one hand in section 7.2.1.1 we have

Content-Type = "Content-Type" ":" media-type NL

and NL is defined as CR | LF. In my understanding that makes "\r\n" illegal indeed!

* On the other hand section 7.2.2 says "Servers MUST resolve conflicts beteen CGI header and HTTP header formats or names (see section 8)." Which might have as a side effect the fact that "\r\n" ends up working in practice.

-- fxn

[*] http://cgi-spec.golux.com/draft-coar-cgi-v11-03-clean.html


-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to