mirror of
https://github.com/PaiGramTeam/luoxu-api-pub.git
synced 2024-11-25 09:27:40 +00:00
fix a bug
This commit is contained in:
parent
c1abdf89ee
commit
c638ccdbcf
2
main.py
2
main.py
@ -78,7 +78,7 @@ async def get_names(request: Request):
|
|||||||
async def read_avatar(avatar: str):
|
async def read_avatar(avatar: str):
|
||||||
async with AsyncClient(timeout=60) as client:
|
async with AsyncClient(timeout=60) as client:
|
||||||
r = await client.get(f"{local_api}avatar/{avatar}")
|
r = await client.get(f"{local_api}avatar/{avatar}")
|
||||||
if r.status_code:
|
if r.status_code == 307:
|
||||||
return RedirectResponse(url=ghost_url)
|
return RedirectResponse(url=ghost_url)
|
||||||
return StreamingResponse(r.aiter_bytes(), media_type="image/png")
|
return StreamingResponse(r.aiter_bytes(), media_type="image/png")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user