MCPcopy Index your code
hub / github.com/RustPython/RustPython / _proxy_bypass_winreg_override

Function _proxy_bypass_winreg_override

Lib/urllib/request.py:2010–2031  ·  view source on GitHub ↗

Return True if the host should bypass the proxy server. The proxy override list is obtained from the Windows Internet settings proxy override registry value. An example of a proxy override value is: "www.example.com;*.example.net; 192.168.0.1"

(host, override)

Source from the content-addressed store, hash-verified

2008
2009# Same as _proxy_bypass_macosx_sysconf, testable on all platforms
2010def _proxy_bypass_winreg_override(host, override):
2011 """Return True if the host should bypass the proxy server.
2012
2013 The proxy override list is obtained from the Windows
2014 Internet settings proxy override registry value.
2015
2016 An example of a proxy override value is:
2017 "www.example.com;*.example.net; 192.168.0.1"
2018 """
2019 from fnmatch import fnmatch
2020
2021 host, _ = _splitport(host)
2022 proxy_override = override.split(';')
2023 for test in proxy_override:
2024 test = test.strip()
2025 # "<local>" should bypass the proxy server for all intranet addresses
2026 if test == '<local>':
2027 if '.' not in host:
2028 return True
2029 elif fnmatch(host, test):
2030 return True
2031 return False
2032
2033
2034if sys.platform == 'darwin':

Callers 1

proxy_bypass_registryFunction · 0.85

Calls 4

_splitportFunction · 0.90
fnmatchFunction · 0.90
splitMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected