Skip to content
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

add http redirect support #306

Closed
wants to merge 0 commits into from
Closed

add http redirect support #306

wants to merge 0 commits into from

Conversation

GongT
Copy link

@GongT GongT commented Sep 5, 2023

fix #302

if (statusCode >= 200 && statusCode < 300)
return resolve(response);

if ((statusCode === 301 || statusCode === 302 || statusCode === 307 || statusCode === 308) && response.headers.location) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ((statusCode === 301 || statusCode === 302 || statusCode === 307 || statusCode === 308) && response.headers.location) {
if ([301, 302, 303, 307].includes(statusCode) && response.headers.location) {

This might be easier to read

README.md Outdated
@@ -228,6 +228,9 @@ same major line. Should you need to upgrade to a new major, use an explicit
manager versions that will be required for the projects you'll run, using
`corepack install -g --cache-only`).

- `COREPACK_FETCH_MAX_REDIRECTS` sets the maximum number of HTTP redirects should
Copy link
Member

@styfle styfle Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this to tests/setupTests.js to ensure this env var is not set.

Also this probably needs to add a test when the env var is set.

@zhyupe
Copy link
Contributor

zhyupe commented Dec 1, 2023

Any future plans on this pr or it's safe to continue working on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

install from npmmirror.com failed (302 redirect)
3 participants