Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requests still use an environment proxy when
NO_PROXYcontains a matching domain suffix, wildcard, or IP subnet. For example,HTTPS_PROXYis used forcvm.tencentcloudapi.comdespiteNO_PROXY=.tencentcloudapi.com. The SDK checks whether the entire host is a substring of the exclusion string, then passes the environment proxy as an explicit Requests proxy. That prevents Requests' own bypass handling from correcting the result.Use Requests' existing
should_bypass_proxiesmatcher with an HTTP/HTTPS URL, and use the same lowercase-firstno_proxyprecedence as Requests. An explicitly configured SDK proxy retains its existing precedence.The new tests exercise the proxies passed to
Session.sendafter normal Requests preparation and environment merging, without making network calls. They cover exact hosts, suffixes, lists, wildcard, IPv4 CIDR, hosts with ports, unmatched hosts, case precedence, and explicit proxies for both HTTP and HTTPS.Validation on Windows / Python 3.12.16 / Requests 2.34.2:
pycodestyle tests/unit/test_proxy.py,git diff --check, andpip checkpass.Live cloud integration tests, the generated-product import matrix, and other Python/OS combinations were not run.
Prepared with OpenAI Codex assistance; the reproduction was found by inspecting the transport code, not from a production incident.