diff options
author | koichik <koichik@improvement.jp> | 2012-01-22 09:55:41 +0400 |
---|---|---|
committer | koichik <koichik@improvement.jp> | 2012-01-22 09:55:41 +0400 |
commit | 3df7c90c3059f49c81f9b8f59fc3abf18d5d392b (patch) | |
tree | 19959dde19e241762ecb75ab00619324b058e041 /lib | |
parent | f2b1f57f74ce23ee7160de76844a71ab34276aa6 (diff) |
http: keep-alive should default with HTTP/1.1 server
As RFC 2616 says we should, assume that servers will provide a persistent
connection by default.
> A significant difference between HTTP/1.1 and earlier versions of
> HTTP is that persistent connections are the default behavior of any
> HTTP connection. That is, unless otherwise indicated, the client
> SHOULD assume that the server will maintain a persistent connection,
> even after error responses from the server.
> HTTP/1.1 applications that do not support persistent connections MUST
> include the "close" connection option in every message.
Fixes #2436.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/http.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/http.js b/lib/http.js index df891867610..a9aaac1c734 100644 --- a/lib/http.js +++ b/lib/http.js @@ -1231,7 +1231,7 @@ ClientRequest.prototype.onSocket = function(socket) { return true; } - if (req.shouldKeepAlive && res.headers.connection !== 'keep-alive' && !req.upgraded) { + if (req.shouldKeepAlive && !shouldKeepAlive && !req.upgraded) { // Server MUST respond with Connection:keep-alive for us to enable it. // If we've been upgraded (via WebSockets) we also shouldn't try to // keep the connection open. |