Skip to content

Commit a592013

Browse files
JacobCoffeeclaude
andcommitted
fix: register MIME types for CSS/JS/SVG in Docker
Docker slim images may have incomplete mimetypes database, causing static files to be served without proper Content-Type headers. Explicitly register common web asset MIME types at module load. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c31b006 commit a592013

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/scribbl_py/app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from __future__ import annotations
88

9+
import mimetypes
910
import os
1011
from contextlib import asynccontextmanager
1112
from typing import TYPE_CHECKING
@@ -27,6 +28,12 @@
2728
if TYPE_CHECKING:
2829
from collections.abc import AsyncGenerator
2930

31+
# Register MIME types for static file serving (Docker slim images may have incomplete mimetypes)
32+
mimetypes.add_type("text/css", ".css")
33+
mimetypes.add_type("application/javascript", ".js")
34+
mimetypes.add_type("image/svg+xml", ".svg")
35+
mimetypes.add_type("application/json", ".json")
36+
3037

3138
@asynccontextmanager
3239
async def lifespan(app: Litestar) -> AsyncGenerator[None, None]:

0 commit comments

Comments
 (0)