Skip to content

Commit

Permalink
[fix] Do not use "Transfer-Encoding: chunked" header for proxied DELE…
Browse files Browse the repository at this point in the history
…TE requests with no "Content-Length" header. Fixes #373.
  • Loading branch information
indexzero committed Mar 9, 2013
1 parent 6a278b3 commit a89e2f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/node-http-proxy/http-proxy.js
Expand Up @@ -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'];
}

Expand Down

0 comments on commit a89e2f2

Please sign in to comment.