Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

http.get never ends #7

Closed
millette opened this Issue Jun 28, 2013 · 9 comments

Comments

Projects
None yet
6 participants

I'm using node v0.10.12 and I'm quite new to this.

This little program doesn't end using follow-redirects but it completes using the native http module:

//var http = require('http');
var http = require('follow-redirects').http;

http.get('http://bit.ly/900913', function (res) {
  var all = '';
  res.on('data', function (chunk) {
    all = all + chunk;
    console.log(all.toString().length);
  });

  res.on('end', function (chunk) {
    console.log(all.toString().length);
  });
}).on('error', function (err) {
  console.error(err);
});

Am I missing something obvious? Or maybe follow-redirects needs to be updated to node 0.10? Any hint would be appreciated. I could slowly take a stab at updating the module if that's indeed the problem.

I wanted to take a stab at #6 but I have to figure this out first.

Owner

olalonde commented Jun 28, 2013

Am I missing something obvious? Or maybe follow-redirects needs to be updated to node 0.10?

That's very possible. I'll have a look tomorrow at this issue, thanks for reporting.

edit: Ha I knew I saw this name somewhere before. I'm also from Montreal 👍

Is this issue still open or is there a workaround known?

Also noticing this issue, agent pool gets filled and I'm left hanging.

daviddenton added a commit to daviddenton/follow-redirects that referenced this issue Dec 20, 2013

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

olalonde added a commit that referenced this issue Feb 27, 2014

Merge pull request #10 from daviddenton/master
fix for issue #7 to consume the stream in a redirect scenario.

juliemr commented May 21, 2014

Also seeing this issue. I'd much prefer to use follow-redirects over a more heavyweight module like request, if this were fixed!

Collaborator

jamestalmage commented Jun 30, 2015

Is this fixed?

Owner

olalonde commented Jul 1, 2015

Sorry everyone. I think this is because I forgot to npm publish the module after @daviddenton fix was merged. Can anyone confirm it is working with a fresh npm install follow-redirects now?

Owner

olalonde commented Jul 1, 2015

Hmmm seems it didn't work. Attempted to fix this again in 0.0.5. This is code I wrote quite a while ago so if this still doesn't work it would be nice if someone could attempt a PR :) The module is only ~100 LoC.

olalonde added a commit that referenced this issue Jul 1, 2015

Collaborator

jamestalmage commented Jul 3, 2015

I believe @olalonde took care of this in @1dd1218, published to npm as 0.0.5. If anyone still has issues, do not hesitate to reopen.

Owner

olalonde commented Jul 4, 2015

@jamestalmage thanks again for helping maintain this module 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment