From 152d258ea00dddfaed28ef934c540169899c1736 Mon Sep 17 00:00:00 2001 From: koichik Date: Fri, 7 Oct 2011 20:37:15 +0900 Subject: [PATCH] [fix] Avoid `Transfer-Encoding: chunked` for HTTP/1.0 client, closes #59. --- lib/node-http-proxy/http-proxy.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 35ddb3d..6c77ac6 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -210,6 +210,11 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { else { response.headers.connection = 'close' } } + // Remove `Transfer-Encoding` header if client's protocol is HTTP/1.0 + if (req.httpVersion === '1.0') { + delete response.headers['transfer-encoding']; + } + // Set the headers of the client response res.writeHead(response.statusCode, response.headers);