diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 24183943c..05ce750d4 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -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']; }