forked from platformio/platformio-core
Handle proxy environment variables in lower case // Resolve #3606
This commit is contained in:
@ -377,9 +377,11 @@ def _internet_on():
|
|||||||
socket.setdefaulttimeout(timeout)
|
socket.setdefaulttimeout(timeout)
|
||||||
for host in PING_REMOTE_HOSTS:
|
for host in PING_REMOTE_HOSTS:
|
||||||
try:
|
try:
|
||||||
if os.getenv("HTTP_PROXY", os.getenv("HTTPS_PROXY")):
|
for var in ("HTTP_PROXY", "HTTPS_PROXY"):
|
||||||
|
if not os.getenv(var, var.lower()):
|
||||||
|
continue
|
||||||
requests.get("http://%s" % host, allow_redirects=False, timeout=timeout)
|
requests.get("http://%s" % host, allow_redirects=False, timeout=timeout)
|
||||||
else:
|
return True
|
||||||
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, 80))
|
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, 80))
|
||||||
return True
|
return True
|
||||||
except: # pylint: disable=bare-except
|
except: # pylint: disable=bare-except
|
||||||
|
Reference in New Issue
Block a user