Repository navigation
Support IP CIDR ranges in NO_PROXY - #1165
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
|
Thanks, this looks good, can you maybe add two more parametrized tests: This expands test coverage, I think might be helpful |
Co-authored-by: Michiel W. Beijen <mb@x14.nl>
@mbeijen Both added - good thinking! |
|
The same functionality is already present in older PR #969 (which is backported from: encode/httpx#3741) |
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
|
@Kludex Thanks for merging this, and sorry it took so much extra work! |
NO_PROXYentries with a CIDR range were turned intoall://192.168.0.0/16, butURLPatternignored the/16. SoNO_PROXY=192.168.0.0/16bypassed the proxy only for192.168.0.0itself, and proxied the other 65,535 addresses. IPv6 ranges likefe80::/10behaved the same way.Discussed in #1164.
What changed
URLPatternmatches IPv4 and IPv6 networks, e.g.all://192.168.0.0/16,all://[fe80::]/10. This applies toNO_PROXYand tomounts.NO_PROXY, like[fe80::]/64, are accepted.IP/digitsor[IPv6]/digits, like curl and Go do. Anything else, e.g.10.0.0.0/33,127.0.0.1/8/../0,127.0.0.1:8080/8,10.0.0.0/8?or[fe80::1%eth0]/64, is ignored inNO_PROXYand raisesInvalidURLinmounts.all://. Host length no longer breaks ties between equal networks, so the scheme does.Behaviour changes
NO_PROXYrange now go direct instead of through the proxy.mountskeys with an IP host and an invalid network now raiseInvalidURLinstead of matching only that host.AI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.