From 58acf28073fe3d841f6d3feb89c9bb5accd14b19 Mon Sep 17 00:00:00 2001 From: yawnt Date: Wed, 12 Jun 2013 18:53:36 +0200 Subject: [PATCH] [fix] better reading --- lib/node-http-proxy/proxy-stream.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/node-http-proxy/proxy-stream.js b/lib/node-http-proxy/proxy-stream.js index 27b6aa8..60c9d67 100644 --- a/lib/node-http-proxy/proxy-stream.js +++ b/lib/node-http-proxy/proxy-stream.js @@ -86,9 +86,8 @@ ProxyStream.prototype.start = function (req) { // // Process the `pReq` `pRes` when it's received. // - (req.httpVersion === '1.0' || !pRes.headers.connection) - && pRes.headers.connection = req.headers.connection - || (req.httpVersion === '1.0' ? 'close' : 'keep-alive'); + (req.httpVersion === '1.0' || !pRes.headers.connection) && + pRes.headers.connection = req.headers.connection || (req.httpVersion === '1.0' ? 'close' : 'keep-alive'); // Remove `Transfer-Encoding` header if client's protocol is HTTP/1.0