fix: return image/apng media type from animated card endpoint (#196) #204
@ -770,7 +770,7 @@ async def get_animated_card(
|
||||
headers = {"Cache-Control": "public, max-age=86400"}
|
||||
|
||||
if os.path.isfile(cache_path) and tier is None:
|
||||
return FileResponse(path=cache_path, media_type="image/png", headers=headers)
|
||||
return FileResponse(path=cache_path, media_type="image/apng", headers=headers)
|
||||
|
|
||||
|
||||
all_pos = (
|
||||
CardPosition.select()
|
||||
@ -860,7 +860,7 @@ async def get_animated_card(
|
||||
finally:
|
||||
await page.close()
|
||||
|
||||
return FileResponse(path=cache_path, media_type="image/png", headers=headers)
|
||||
return FileResponse(path=cache_path, media_type="image/apng", headers=headers)
|
||||
|
||||
|
||||
@router.get("/{player_id}/{card_type}card")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user
BLOCKING: This cache-hit return path also needs
media_type="image/apng". It serves the same APNG file but still returns the wrong MIME type. Since most production requests hit this path after first render, the fix at line 863 will almost never take effect.