mirror of https://github.com/python/cpython.git
Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the
"<local>" macro as the only entry, this function bypasses any host name that does not contain a period.
This commit is contained in:
parent
55708cce31
commit
4947606ecc
|
@ -2244,18 +2244,11 @@ def proxy_bypass_registry(host):
|
||||||
# '<local>' string by the localhost entry and the corresponding
|
# '<local>' string by the localhost entry and the corresponding
|
||||||
# canonical entry.
|
# canonical entry.
|
||||||
proxyOverride = proxyOverride.split(';')
|
proxyOverride = proxyOverride.split(';')
|
||||||
i = 0
|
|
||||||
while i < len(proxyOverride):
|
|
||||||
if proxyOverride[i] == '<local>':
|
|
||||||
proxyOverride[i:i+1] = ['localhost',
|
|
||||||
'127.0.0.1',
|
|
||||||
socket.gethostname(),
|
|
||||||
socket.gethostbyname(
|
|
||||||
socket.gethostname())]
|
|
||||||
i += 1
|
|
||||||
# print proxyOverride
|
|
||||||
# now check if we match one of the registry values.
|
# now check if we match one of the registry values.
|
||||||
for test in proxyOverride:
|
for test in proxyOverride:
|
||||||
|
if test == '<local>':
|
||||||
|
if '.' not in rawHost:
|
||||||
|
return 1
|
||||||
test = test.replace(".", r"\.") # mask dots
|
test = test.replace(".", r"\.") # mask dots
|
||||||
test = test.replace("*", r".*") # change glob sequence
|
test = test.replace("*", r".*") # change glob sequence
|
||||||
test = test.replace("?", r".") # change glob char
|
test = test.replace("?", r".") # change glob char
|
||||||
|
|
Loading…
Reference in New Issue