From adb67631947d8ef303808e8ef1758da096d57eae Mon Sep 17 00:00:00 2001 From: yawnt Date: Wed, 12 Jun 2013 18:47:32 +0200 Subject: [PATCH] [fix] typo --- lib/node-http-proxy/proxy-stream.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/node-http-proxy/proxy-stream.js b/lib/node-http-proxy/proxy-stream.js index 31dd2d3..19e0584 100644 --- a/lib/node-http-proxy/proxy-stream.js +++ b/lib/node-http-proxy/proxy-stream.js @@ -86,7 +86,11 @@ ProxyStream.prototype.start = function (req) { // // Process the `pReq` `pRes` when it's received. // - pRes.headers.connection = req.headers.connection || req.httpVersion === '1.0' ? 'close' : 'keep-alive'; + if (req.httpVersion === '1.0') { + pRes.headers.connection = req.headers.connection || 'close'; + } else if (!pRes.headers.connection) { + pRes.headers.connection = req.headers.connection || 'keep-alive'; + } // Remove `Transfer-Encoding` header if client's protocol is HTTP/1.0 // or if this is a DELETE request with no content-length header.