mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Fix closes issue12698 - make the no_proxy environment variable handling a bit lenient (accomodate spaces in between the items)
This commit is contained in:
parent
e5cad23a92
commit
89976f1cdc
2 changed files with 5 additions and 2 deletions
|
|
@ -2265,7 +2265,8 @@ def proxy_bypass_environment(host):
|
|||
# strip port off host
|
||||
hostonly, port = splitport(host)
|
||||
# check if the host ends with any of the DNS suffixes
|
||||
for name in no_proxy.split(','):
|
||||
no_proxy_list = [proxy.strip() for proxy in no_proxy.split(',')]
|
||||
for name in no_proxy_list:
|
||||
if name and (hostonly.endswith(name) or host.endswith(name)):
|
||||
return 1
|
||||
# otherwise, don't bypass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue