[fix] Set "content-length" header to "0" if it is not already set on DELETE requests. Fixes #338.

This commit is contained in:
indexzero 2013-03-09 02:44:28 -05:00
parent a89e2f2688
commit 9be0af3166

View File

@ -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