Permalink
Browse files

Remove content related headers properly.

  • Loading branch information...
1 parent 7b602df commit 95632082f103df9d9c88a11fa52324b9ba196228 @ma2rten ma2rten committed Jul 20, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/node.io/request.js
View
@@ -357,6 +357,13 @@ Job.prototype.doRequest = function (method, resource, body, headers, callback, p
headers.host = redirect.host;
}
if (code === 302 || code === 303) {
+ // make a get requeet out of this
+ for (header in headers) {
+ h = header.toLowerCase();
+ if (h === 'content-length' || h === 'content-type') {
+ delete headers[header];
+ }
+ }
self.doRequest('GET', location, null, headers, callback, parse, ++redirects);
} else {
self.doRequest(method, location, body, headers, callback, parse, ++redirects);

0 comments on commit 9563208

Please sign in to comment.