[py] fix no_proxy matching so empty entries and substrings do not bypass the proxy - #17884
Conversation
PR Summary by QodoFix Python no_proxy matching to ignore empty entries and avoid substring bypass
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. Docstring Args missing types
|
cgoldberg
left a comment
There was a problem hiding this comment.
It's probably worth fixing the IPv6 edge case that qodo bot mentioned and adding a test for it. Besides that, LGTM .. nice addition of unit tests
|
Code review by qodo was updated up to the latest commit 7ac9352 |
🔗 Related Issues
💥 What does this PR do?
ClientConfig.get_proxy_url()tested whether ano_proxyentry covered the remote server address with a substring check (n_url.path in remote_add.netloc), which had three defects:""parses to an empty path and"" in anythingisTrue, so the first empty entry short-circuited to "bypass" for every host,no_proxy=example.com,silently sent all driver traffic direct.no_proxy=foo.combypassed the proxy formyfoo.com.other.org.NO_PROXY=EXAMPLE.COMmissedexample.com.🔧 Implementation Notes
🤖 AI assistance
💡 Additional Considerations
🔄 Types of changes