fix a bug

This commit is contained in:
xtaodada 2023-09-14 23:27:04 +08:00
parent c1abdf89ee
commit c638ccdbcf
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -78,7 +78,7 @@ async def get_names(request: Request):
async def read_avatar(avatar: str):
async with AsyncClient(timeout=60) as client:
r = await client.get(f"{local_api}avatar/{avatar}")
if r.status_code:
if r.status_code == 307:
return RedirectResponse(url=ghost_url)
return StreamingResponse(r.aiter_bytes(), media_type="image/png")