-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have needle follow redirects #361
Conversation
Redirect following for binary installations was broken with the switch to needle (in 9a9089b). This replaces the functionality.
a922516
to
7b631ed
Compare
lib/install.js
Outdated
@@ -105,7 +106,10 @@ function place_binary(from,to,opts,callback) { | |||
}); | |||
|
|||
req.on('response', function(res) { | |||
if (res.statusCode !== 200) { | |||
if (res.statusCode === 302) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to allow other 30x codes here too I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it to check for a Location: header instead.
Thanks for catching this regression. Before merging this we'll need some kind of test to make sure it is actually working + does not regress again. Could you add a test? |
This will handle things needle thinks are redirects without having to check a bunch of status codes.
This introduces nock as a means of mocking HTTP requests.
FYI, I've just now noticed the error and have been able to repro it (using Node 4 under OSX, Node 6 on my box seems to work fine). I'll be able to tackle this in a couple hours. |
It affects all node versions, all systems. |
be9fdeb
to
c6e5eab
Compare
So it doesn't fail on non-OSX, non-node-4 platforms.
c6e5eab
to
b2e0d08
Compare
- caused by allenluce/mmap-object#14 - which is transitively caused by mapbox/node-pre-gyp#361
Is there something keeping this from being merged? |
Thanks for this work, it is now included in |
Regression was fixed by mapbox/node-pre-gyp#361
Have needle follow redirects
Redirect following for binary installations broke with the switch to needle. This replaces the functionality.
Not having a redirect means (at least in my case) that pre-built binaries that are registered as part of a Github release cannot be downloaded.
This addresses #359