

Ask HN: Bug in Hacker News ResponseStatusLine - pj

<i>Could not load feed - The server committed a protocol violation. Section=ResponseStatusLine</i><p>Looks like the web server isn't sending back enough headers:<p><pre><code>  HTTP/1.x 200 OK
  Content-Type: text/html; charset=utf-8
  Connection: close
</code></pre>
Where are Content-Length, Last-Modified, etc?<p>Should be more detailed like this one from google.com:<p><pre><code>  HTTP/1.x 200 OK
  Content-Type: image/x-icon
  Last-Modified: Fri, 09 Jan 2009 16:35:02 GMT
  Date: Fri, 05 Jun 2009 17:40:31 GMT
  Expires: Sat, 05 Jun 2010 17:40:31 GMT
  Cache-Control: public, max-age=31536000
  Server: gws
  Content-Length: 1150
  Age: 1
</code></pre>
Or this one:<p><pre><code>  HTTP/1.x 200 OK
  Cache-Control: private, max-age=0
  Date: Fri, 05 Jun 2009 17:40:31 GMT
  Expires: -1
  Content-Type: text/html; charset=UTF-8
  Content-Encoding: gzip
  Server: gws
  Content-Length: 3279</code></pre>
======
pg
Sounds like you have a very picky feed reader. Which one is it? And what
specifically is it complaining about?

Does anyone know if the http protocol actually mandates more header lines than
we're supplying?

~~~
sayrer
Hmm, it is complaining about the status line (the first one). I think it is
choking on the HTTP 1.0 response with a Connection header. That header was
added in HTTP 1.1, but lots of people use it with HTTP 1.0 and pretty much
everyone supports it. (edit: by which I mean they ignore it, because
connection: close is the default behavior in HTTP 1.0)

That said, you should add an ETag to the response. Hacker News changes often
enough that timed expiration won't help, but ETags might get you a lot of 304
Not Modified responses.

~~~
pg
So if I just change the current header to say HTTP 1.1 am I done, or does that
require additional changes?

~~~
sayrer
It doesn't require additional changes. I'm not sure it will fix the .NET
client library's paranoia though--I was only guessing.

