[fix] Avoid Transfer-Encoding: chunked for HTTP/1.0 client, closes #59.

This commit is contained in:
koichik 2011-10-07 20:37:15 +09:00 committed by Charlie McConnell
parent c98ccb40e9
commit 152d258ea0

View File

@ -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);