[fix] Do not use "Transfer-Encoding: chunked" header for proxied DELETE requests with no "Content-Length" header. Fixes #373.

This commit is contained in:
indexzero 2013-03-09 02:40:09 -05:00
parent 6a278b3dd8
commit a89e2f2688

View File

@ -253,7 +253,10 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
}
// Remove `Transfer-Encoding` header if client's protocol is HTTP/1.0
if (req.httpVersion === '1.0') {
// or if this is a DELETE request with no content-length header.
// See: https://github.com/nodejitsu/node-http-proxy/pull/373
if (req.httpVersion === '1.0' || (req.method === 'DELETE'
&& !req.headers['content-length'])) {
delete response.headers['transfer-encoding'];
}