Update nonebot/drivers/fastapi.py

This commit is contained in:
Ju4tCode 2021-12-04 14:15:00 +08:00 committed by GitHub
parent 226fc0feb3
commit aea961b346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -467,10 +467,10 @@ class FullDriver(ForwardDriver, Driver):
continue
if not client:
client = httpx.AsyncClient(http2=http2, follow_redirects=True)
client = httpx.AsyncClient(http2=setup.http_version == "2", follow_redirects=True)
elif http2 != (setup.http_version == "2"):
await client.aclose()
client = httpx.AsyncClient(http2=http2, follow_redirects=True)
client = httpx.AsyncClient(http2=setup.http_version == "2", follow_redirects=True)
http2 = setup.http_version == "2"
if not bot: