mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] Set "content-length" header to "0" if it is not already set on DELETE requests. Fixes #338.
This commit is contained in:
parent
a89e2f2688
commit
9be0af3166
@ -126,6 +126,12 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
|
||||
reverseProxy,
|
||||
location;
|
||||
|
||||
// If this is a DELETE request then set the "content-length"
|
||||
// header (if it is not already set)
|
||||
if (req.method === 'DELETE') {
|
||||
req.headers['content-length'] = req.headers['content-length'] || '0';
|
||||
}
|
||||
|
||||
//
|
||||
// Add common proxy headers to the request so that they can
|
||||
// be availible to the proxy target server. If the proxy is
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user