Permalink
Browse files

[fix] Set "content-length" header to "0" if it is not already set on …

…DELETE requests. Fixes #338.
  • Loading branch information...
1 parent a89e2f2 commit 9be0af3166ffabc730c186d748af4ebab072569b @indexzero indexzero committed Mar 9, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 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

0 comments on commit 9be0af3

Please sign in to comment.