From dcff8332a2d803ab506d2e676c31d34dc80fb446 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 7 Apr 2026 20:01:48 -0500 Subject: [PATCH 1/2] fix: return image/apng media type from animated card endpoint (#196) Closes #196 Co-Authored-By: Claude Sonnet 4.6 --- app/routers_v2/players.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routers_v2/players.py b/app/routers_v2/players.py index 34fefe1..414f6cb 100644 --- a/app/routers_v2/players.py +++ b/app/routers_v2/players.py @@ -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") From cf7279a573af03e62c4c7325dffa312ffc0711b5 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 7 Apr 2026 20:31:11 -0500 Subject: [PATCH 2/2] fix: also update cache hit path to return image/apng media type (#204) The cache hit branch at line 773 still returned image/png, meaning the MIME type fix was never seen in production since cached responses dominate. Update it to match the cache miss path. Co-Authored-By: Claude Sonnet 4.6 --- app/routers_v2/players.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routers_v2/players.py b/app/routers_v2/players.py index 414f6cb..0175bab 100644 --- a/app/routers_v2/players.py +++ b/app/routers_v2/players.py @@ -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()