Permalink
Browse files

[fix] Do not use "Transfer-Encoding: chunked" header for proxied DELE…

…TE requests with no "Content-Length" header. Fixes #373.
  • Loading branch information...
1 parent 6a278b3 commit a89e2f2688ffbfac53ee89121c8bf067ff43a47e @indexzero indexzero committed Mar 9, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 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'];
}

0 comments on commit a89e2f2

Please sign in to comment.