forked from forks/microblog.pub
Tweak proxy client
This commit is contained in:
parent
a82f619e89
commit
0527e34476
1 changed files with 24 additions and 26 deletions
12
app/main.py
12
app/main.py
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue