Skip to content
Browse files

fix for issue #7 to consume the stream in a redirect scenario. this i…

…s required for node 0.8.x -> 0.10.x API changes
  • Loading branch information...
1 parent 84f0bb1 commit 99acea69f837adb2027c74a9bf14498a974adba2 @daviddenton daviddenton committed Dec 20, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 index.js
4 index.js
@@ -78,6 +78,10 @@ for (var protocol in protocols) {
return redirect.userCallback(res);
+ // we are going to follow the redirect, but in node 0.10 we must first attach a data listener
+ // to consume the stream and send the 'end' event
+ res.on('data', function() {});
// save the original clientRequest to our redirectOptions so we can emit errors later
// need to use url.resolve() in case location is a relative URL

0 comments on commit 99acea6

Please sign in to comment.
Something went wrong with that request. Please try again.