joyent/http-parser — pull request #79 by gwik (2012-01-24 00:01:27+00:00)
Title: Fix HTTP 1.1 read until EOF / connection close behavior

The parser should not close the connection nor try to read until EOF if the protocol is 1.1 and the Connection: close header is not set according to the RFC[1]. This was making the parser to close the connection for every message without a body if the Content-Length was not 0.

For example:

HTTP/1.1 200 OK\r\n\r\n

Should not close the connection.

HTTP/1.1 200 OK\r\n
Connection: close\r\n
\r\n
Hello world!

Should read until EOF and close the connection.

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4 (.5)