Tweak proxy client

This commit is contained in:
Thomas Sileo 2022-12-02 18:48:05 +01:00
parent a82f619e89
commit 0527e34476

View file

@ -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( async def _proxy_get(
request: starlette.requests.Request, url: str, stream: bool request: starlette.requests.Request, url: str, stream: bool
) -> httpx.Response: ) -> 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) # Request the URL (and filter request headers)
proxy_req = proxy_client.build_request( proxy_req = proxy_client.build_request(
request.method, request.method,