in reply to Premature end of script

I don't know whether this matters, but http defines the header as "Content-Type:"

BCE
--Your punctuation skills are insufficient!

Replies are listed 'Best First'.
Re: Re: Premature end of script
by sauoq (Abbot) on Aug 13, 2002 at 05:00 UTC
    I don't know whether this matters, but http defines the header as "Content-Type:"

    It doesn't. Section 4.2, "Message Headers" of rfc2616 states:

    Field names are case-insensitive.

    Although the RFC is mostly consistent in its use of "Content-Type", there is an example under Section 19.2, "Internet Media Type multipart/byteranges" where the capitalization "Content-type" is used three times.

    My own use of that capitalization is a habit. I can trace it back to the examples in the first printing of "the mouse" which was my primary reference when I started writing CGI scripts. That was Way Back When[tm] it was still CGI Programming on the World Wide Web rather than CGI Programming with Perl, authorship wasn't shared, and cgi-lib.pl was still preferred for two reasons: Lincoln hadn't turned his buggy CGI::* modules into a coherent and stable CGI.pm yet and a lot of us were still using perl4.

    As if this answer wasn't long enough, I had a look at the CGI 1.1 Specification draft Revision 03 (expired) too. It uses both capitalizations as well. The BNF seems to indicate that the script is to return a "Content-type" field.

    This answer is long enough now that I might as well turn it into a soap box (for completeness if nothing else.) So, if you think an RFC specifying CGI makes sense, ping Ken Coar about it. The effort pretty much came to a halt after revision 3 of the draft. I did get a response from Ken on the CGI-WG list in early June though, so there might still be hope.

    -sauoq
    "My two cents aren't worth a dime.";
    

      Thanks for the correction, sauoq. I thought it might be case-insensitive, but couldn't find (in my all-too-brief search) the relevant RFC(s). Proof that unofficial sources are not to be trusted. :-/

      BCE
      --You'reYour punctuation skills are insufficient!