mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Don't follow redirects when checking internet connection
This commit is contained in:
@ -669,7 +669,8 @@ def _internet_on():
|
||||
for ip in PING_INTERNET_IPS:
|
||||
try:
|
||||
if os.getenv("HTTP_PROXY", os.getenv("HTTPS_PROXY")):
|
||||
requests.get("http://%s" % ip, timeout=timeout)
|
||||
requests.get(
|
||||
"http://%s" % ip, allow_redirects=False, timeout=timeout)
|
||||
else:
|
||||
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((ip,
|
||||
80))
|
||||
|
@ -19,4 +19,4 @@ from platformio import util
|
||||
|
||||
def test_ping_internet_ips():
|
||||
for ip in util.PING_INTERNET_IPS:
|
||||
requests.get("http://%s" % ip, timeout=2)
|
||||
requests.get("http://%s" % ip, allow_redirects=False, timeout=2)
|
||||
|
Reference in New Issue
Block a user