for scheme in ("http", "https", "all"):
if proxy_info.get(scheme):
hostname = proxy_info[scheme]
- mounts[scheme] = hostname if "://" in hostname else f"http://{hostname}"
+ mounts[f"{scheme}://"] = (
+ hostname if "://" in hostname else f"http://{hostname}"
+ )
no_proxy_hosts = [host.strip() for host in proxy_info.get("no", "").split(",")]
for hostname in no_proxy_hosts:
["environment", "proxies"],
[
({}, {}),
- ({"HTTP_PROXY": "http://127.0.0.1"}, {"http": "http://127.0.0.1"}),
+ ({"HTTP_PROXY": "http://127.0.0.1"}, {"http://": "http://127.0.0.1"}),
(
{"https_proxy": "http://127.0.0.1", "HTTP_PROXY": "https://127.0.0.1"},
- {"https": "http://127.0.0.1", "http": "https://127.0.0.1"},
+ {"https://": "http://127.0.0.1", "http://": "https://127.0.0.1"},
),
- ({"all_proxy": "http://127.0.0.1"}, {"all": "http://127.0.0.1"}),
+ ({"all_proxy": "http://127.0.0.1"}, {"all://": "http://127.0.0.1"}),
({"TRAVIS_APT_PROXY": "http://127.0.0.1"}, {}),
],
)
("all://example.com", "https://example.com", True,),
("http://", "http://example.com", True,),
("http://", "https://example.com", False,),
- ("http", "http://example.com", True,),
- ("http", "https://example.com", False,),
- ("all", "https://example.com:123", True,),
+ ("all://", "https://example.com:123", True,),
("", "https://example.com:123", True,),
],
)