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

If NPM config's noproxy is set, NO_PROXY rules will apply incorrectly #8287

Closed
flotwig opened this issue Aug 14, 2020 · 4 comments · Fixed by #8295
Closed

If NPM config's noproxy is set, NO_PROXY rules will apply incorrectly #8287

flotwig opened this issue Aug 14, 2020 · 4 comments · Fixed by #8295
Labels
type: regression A bug that didn't appear until a specific Cy version release v4.11.0 🐛 Issue present since 4.11.0

Comments

@flotwig
Copy link
Contributor

flotwig commented Aug 14, 2020

Current behavior:

After merging #7900, changes in proxy-from-env cause the npm_config_noproxy environment variable to be considered above NO_PROXY. This is problematic because internally, we set NO_PROXY to contain the user's original NO_PROXY settings, as well as things which should never be proxied like localhost. The end result is bad behavior, like requests for localhost being sent through the proxy.

Desired behavior:

npm_config_noproxy acts as a fallback for NO_PROXY.

Workaround

Ensure that NPM config's noproxy setting is empty when launching Cypress, so that NO_PROXY is preferred. This can be done via environment variables.

For example (Linux/macOS):

npm_config_noproxy= npm run cypress:run

Or on Windows, using cross-env:

cross-env npm_config_noproxy= npm run cypress:run

┆Issue is synchronized with this Jira Features by Unito

@flotwig flotwig added type: regression A bug that didn't appear until a specific Cy version release v4.11.0 🐛 Issue present since 4.11.0 labels Aug 14, 2020
@flotwig
Copy link
Contributor Author

flotwig commented Aug 14, 2020

For now I think it's best to just revert the dep update, and wait to see if https://github.com/Rob--W/proxy-from-env/issues/13 is implemented, in which case we can use that version.

@jennifer-shehane
Copy link
Member

this update shouldn't affect users

Famous last words

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 24, 2020

The code for this is done in cypress-io/cypress#8295, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Aug 24, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 1, 2020

Released in 5.1.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v5.1.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: regression A bug that didn't appear until a specific Cy version release v4.11.0 🐛 Issue present since 4.11.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants