On 6/22/2016 7:41 PM, Michael Ezzell wrote:
> On Jun 22, 2016 7:06 PM, "Shawn Heisey" <hapr...@elyograg.org
> <mailto:hapr...@elyograg.org>> wrote:
> >
> > I have verified that there is nothing on the line after the headers.  On
> > the recommendation I saw elsewhere, the file is in DOS text format, so
> > each line ends in CRLF, not just LF.  Could the line endings be the
> problem?
>
> Most definitely.
>
> Review the file's content with a hex editor or hexdump.
>
> Each line of headers *must* end with \r\n which is 0x0d 0x0a (CR,
> LF).  This file is used as a raw HTTP response, and the Chrome error
> suggests strongly that this is your problem, or this:
>
> After the last header, you *must* have two sets of of those, e.g.:
>
> HTTP/1.0 503 Service Unavailable [0d][0a]Content-Type:
> text/html[0d][0a]Cache-Control: no-cache [0d][0a]Connection:
> close[0d][0a][0d][0a]<html>...
>
> After that point, you're in the body, so pretty much anything goes,
> just keep the whole thing under 16K.
>
> Definitely don't count on an indicator of "file format" to prove that
> this is correct.
>
> Copy one of the other files and edit with vim.  You'll see the ^M in
> the headers, which of course is the same as \r.  The \n doesn't show
> in vim since that's the normal newline.

I do all my config editing in vim.  It doesn't show ^M -- it just adds
[dos] to the status line, to indicate that the line endings are not
standard.  I have seen ^M in my editor before -- I wonder if maybe I was
using nvi or vim-tiny rather than the full vim on those occasions.

Using hexedit revealed a problem that vim hid from me -- there was a
single space on what I thought was a blank line, so after the last
header, the hex was 0D 0A 20 0D 0A.

I fixed this in my file by removing the space, and when we can get the
client to allow us another testing window, I will give it another try. 
Hopefully everything will work.

As usual, Chrome and Firefox are handling my mistake according to what
the standards actually state, and IE ignores all the rules.

Thank you for the pointers!

Shawn


Reply via email to