Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 99acea69f837adb2027c74a9bf14498a974adba2 1 parent 84f0bb1
@daviddenton daviddenton authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 index.js
View
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
Please sign in to comment.
Something went wrong with that request. Please try again.