fix: Respect HTTPS_PROXY and other settings from env vars #592
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.
Fixes
Feature addition.
This is a followup from #409, where this goes further to allow setting proxy servers using the typical environment variables, as opposed to passing them in via the python interface.
See the docs here:
https://docs.python-requests.org/en/master/user/advanced/
I would like for this library to respect all of these settings without extra work on the python interface to it. This appears to be the canonical way to work this into the requests library usage happening here.
This unfortunately increase the amount of mocking required, as the new call to
merge_environment_settings
will do a URL split on the request's URL. This means that the request object needs to be more complex thanMock()
.Checklist
If you have questions, please file a support ticket, or create a GitHub Issue in this repository.