Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Inline port numbers in URLs cause request to spawn multiple callback chains which loop "endlessly" #98
I've been using request for a small project where we crawl some pages on a site I work on. We noticed an issue where request was entering an "endless" loop when attempting to follow a redirect.
Further investigation showed that
I've attached some code demonstrating this behavior here: https://gist.github.com/1316008
I've also attached a sketch-of-a-patch. It appeared that by passing the same object around everywhere as options to callbacks that various callbacks were being run multiple times and that multiple chains of processing were running. Stopping that behavior by copying only the necessary properties into a new Object of properties given to the http or https module caused the problem to cease -- even when the same Agent is passed through.
To be honest, I'm submitting this in a gist not in a pull request because I don't really have a thorough enough understanding of why this fixes things. That means I view it as a piece of diagnostic information not a viable fix in its own right.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
a lot of changes in this code have rolled in over the last few days. the fact that you're still referencing options means you're using an older version.
also, @isaacs changed our url parsing/handling and i merged it just yesterday. could you please try out master HEAD and tel me if this is still an issue?