Skip to content

Commit

Permalink
download: http: fixed proxy usage with httpx < 0.26
Browse files Browse the repository at this point in the history
  • Loading branch information
nE0sIghT committed Nov 22, 2024
1 parent e4eaa4a commit ef97384
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apt_mirror/download/protocols/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __post_init__(self):

proxy_mounts: dict[str, httpx.AsyncHTTPTransport] = {}
for scheme in ("http://", "https://"):
proxy = self._proxy.for_scheme(scheme)
proxy_mounts[scheme] = httpx.AsyncHTTPTransport(
verify=self._verify_ca_certificate,
http1=True,
Expand All @@ -32,7 +33,7 @@ def __post_init__(self):
max_keepalive_connections=32,
keepalive_expiry=5,
),
proxy=self._proxy.for_scheme(scheme),
proxy=httpx.Proxy(proxy) if proxy else None,
retries=5,
)

Expand Down

0 comments on commit ef97384

Please sign in to comment.