-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: add minimal node-request #2198
Conversation
098907d
to
4db4bbc
Compare
btw there's also this discussion: npm/cli#1281 (comment) where Isaac suggested make-fetch-happen as an alternative - which would have one benefit of de-duping when bundled with npm. Although I haven't looked at the API and how difficult it might be. Once upon a time I did have a look at using the npm http client and decided it was too different to bother but I think that was pre make-fetch-happen. And the streaming+sha thing is a good (but not insurmountable) point. Re semver-major, I think I'd be inclined to do so, not because we know there's breaking changes, but because this touches things that are likely to find breaking edges. But bumping to 8.0.0 isn't a big deal, I'd be happy to do that if this got merged. |
Sooooo upon reviewing it, this is a lot of code and looks like a separate package to me and maybe should just be published as its own thing. I'm not sure if it's worth going that far but this is a fair amount of code that we're taking a testing and maintenance burden for. Also this:
Is there a possibility that people are re-inserting authentication via environment variables that |
Per https://github.com/request/request/blob/master/lib/auth.js it only handles authentication headers, url basic auth is not touched, which is nice. Isn't the sha checking, a security feature? Probably best to not get rid of it. with |
yeah, not suggesting getting rid of it, just that it's not impossible to do it without handling it via the incoming stream, you can do it after the fact
I would hope that whatever npm is doing for proxies would cover what we're doing here. It's true that they download from different sources, but the people that need to proxy for node-gyp also need to proxy for npm. So maybe the delta isn't that big? I just hate that we have to take on so much code burden to deal with this, http isn't supposed to be this complicated but we've built up so much technical debt here, in terms of code and features we afford users. |
btw it's not a NO to this PR, it's just not simple given the amount of code being introduced so I need time to form a stronger opinion, perhaps others want to weigh in. |
Adds a stripped down `node-request` to stop deprecated warnings from bubbling up to the user.
Description of change
The goal is to get rid of
node-request
. Initially I though of replacing the client with something lightweight likenode-fetch
, but the SHA validation require a streaming model which do not work will with promise-based http clients. So based on the input tonode-request
, I stripped out anything that doesn't have an effect like authentication which led to this very lightweight clone of the original module.resolves #2047
cc @rvagg
Checklist
npm install && npm test
passes