mirror of https://github.com/python/cpython.git
Patch #1426648: urllib proxy_bypass broken
This commit is contained in:
parent
4caeff9867
commit
1f63670a2a
|
@ -1403,13 +1403,20 @@ def proxy_bypass(host):
|
||||||
if not proxyEnable or not proxyOverride:
|
if not proxyEnable or not proxyOverride:
|
||||||
return 0
|
return 0
|
||||||
# try to make a host list from name and IP address.
|
# try to make a host list from name and IP address.
|
||||||
host = [host]
|
rawHost, port = splitport(host)
|
||||||
|
host = [rawHost]
|
||||||
try:
|
try:
|
||||||
addr = socket.gethostbyname(host[0])
|
addr = socket.gethostbyname(rawHost)
|
||||||
if addr != host:
|
if addr != rawHost:
|
||||||
host.append(addr)
|
host.append(addr)
|
||||||
except socket.error:
|
except socket.error:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
fqdn = socket.getfqdn(rawHost)
|
||||||
|
if fqdn != rawHost:
|
||||||
|
host.append(fqdn)
|
||||||
|
except socket.error:
|
||||||
|
pass
|
||||||
# make a check value list from the registry entry: replace the
|
# make a check value list from the registry entry: replace the
|
||||||
# '<local>' string by the localhost entry and the corresponding
|
# '<local>' string by the localhost entry and the corresponding
|
||||||
# canonical entry.
|
# canonical entry.
|
||||||
|
|
Loading…
Reference in New Issue