diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 05ce750..38841b6 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -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