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 lowercase proxy vars and make priority consistent with other tools #16287

Merged
merged 2 commits into from
May 11, 2024

Conversation

jgoodson
Copy link
Contributor

@jgoodson jgoodson commented May 6, 2024

References

Resolves #16286

Code changes

This modifies the code for obtaining a proxy URL from the environment to first check http_proxy/https_proxy, consistent with discussion and recommendations from this Gitlab engineering blog post.

The recommendation from the linked post following a discussion of issues that can arise is:

Prefer lowercase forms over uppercase variables (e.g. http_proxy should be searched before HTTP_PROXY).

This also slightly changes the priority of HTTP vs "ALL" proxy environment variables to favor more specificity. If only HTTP_PROXY is set, behavior will be as before. If both are set, the value of http_proxy will be used.

User-facing changes

This won't have any changed effect if only HTTP_PROXY is set, but it will now detect the more-common http_proxy. If both upper- and lower-case variants are set and have different values (why?) the lower-case variant will be preferred, consistent with other tools. Additionally, if both ALL_PROXY and HTTP_PROXY are set to different values, this code will change the resulting HTTPS proxy to be the URL from HTTP_PROXY and not ALL_PROXY, again consistent with other tools.

Backwards-incompatible changes

No backwards incompatibility, only minor changes in behavior in edge cases. The resulting behavior should be more consistent with that of other tools.

Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

Copy link

welcome bot commented May 6, 2024

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@krassowski krassowski added the bug label May 7, 2024
@krassowski krassowski added this to the 4.2.x milestone May 7, 2024
Co-authored-by: Jason Weill <93281816+JasonWeill@users.noreply.github.com>
Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @jgoodson!

@krassowski krassowski merged commit 7ae2d43 into jupyterlab:main May 11, 2024
81 checks passed
Copy link

welcome bot commented May 11, 2024

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

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

Successfully merging this pull request may close these issues.

PyPI extension search not functional with lowercase http_proxy environment variable.
3 participants