Tweak proxy client

v2
Thomas Sileo 2022-12-02 18:48:05 +01:00
rodzic a82f619e89
commit 0527e34476
1 zmienionych plików z 24 dodań i 26 usunięć

Wyświetl plik

@ -1179,16 +1179,14 @@ async def nodeinfo(
)
proxy_client = httpx.AsyncClient(
follow_redirects=True,
timeout=httpx.Timeout(timeout=10.0),
transport=httpx.AsyncHTTPTransport(retries=1),
)
async def _proxy_get(
request: starlette.requests.Request, url: str, stream: bool
) -> httpx.Response:
async with httpx.AsyncClient(
follow_redirects=True,
timeout=httpx.Timeout(timeout=10.0),
transport=httpx.AsyncHTTPTransport(retries=1),
) as proxy_client:
# Request the URL (and filter request headers)
proxy_req = proxy_client.build_request(
request.method,