for scheme in ("http", "https", "all"):
if proxy_info.get(scheme):
- mounts[scheme] = proxy_info[scheme]
+ hostname = proxy_info[scheme]
+ mounts[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:
{"HTTP_PROXY": "http://example.com"},
"http://example.com",
),
+ # Auto prepend http scheme
+ ("http://google.com", {"HTTP_PROXY": "example.com"}, "http://example.com"),
(
"http://google.com",
{"HTTP_PROXY": "http://example.com", "NO_PROXY": "google.com"},