mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] Do not use "Transfer-Encoding: chunked" header for proxied DELETE requests with no "Content-Length" header. Fixes #373.
This commit is contained in:
parent
6a278b3dd8
commit
a89e2f2688
@ -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'];
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user