Add lowercase proxy vars and make priority consistent with other tools #16287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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 ofhttp_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-commonhttp_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 bothALL_PROXY
andHTTP_PROXY
are set to different values, this code will change the resulting HTTPS proxy to be the URL fromHTTP_PROXY
and notALL_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.