Permalink
Browse files

do a GET request after a 302 or 303 redirect

  • Loading branch information...
1 parent ea1b22f commit bce292467b2471fc274ed34e591f1326e9fd42e3 @ma2rten ma2rten committed Jul 20, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/node.io/request.js
View
@@ -354,7 +354,11 @@ Job.prototype.doRequest = function (method, resource, body, headers, callback, p
if (redirect.host) {
headers.host = redirect.host;
}
- self.doRequest(method, location, body, headers, callback, parse, ++redirects);
+ if (code === 302 || code === 303) {
+ self.doRequest('GET', location, null, headers, callback, parse, ++redirects);
+ } else {
+ self.doRequest(method, location, body, headers, callback, parse, ++redirects);
+ }
}
return;
}

0 comments on commit bce2924

Please sign in to comment.