fix: serve WebP with a portable MIME type

This commit is contained in:
nyan404 committed 2026-11-17 16:34:10 +03:00
1 parent d182cd30fa
commit 30d012de80
5 files changed
+23 -1

No files matched your search

+6
View File
@@ -1,5 +1,11 @@
# Structure and Data
## Portable WebP MIME response — 2026-11-17
- Reproduced the reported CI mismatch in stock `python:3.12-slim` (Python 3.12.16): strict `mimetypes.guess_type("forest.webp")` returns `(None, None)` while the non-strict common table contains `image/webp`. The workstation MIME database masked this during the original checks.
- `app/main.py` `Handler._file` now explicitly sets `image/webp` for `.webp` (case-insensitive); all other formats keep the existing lookup/fallback. No dependency, image definition, route, game logic or gateway configuration change. `tests/test_lu_trainer.py` adds an HTTP regression check with MIME guessing unavailable.
- Validation passed: 4 focused trainer HTTP tests locally; all 178 Python discovery tests in disposable `python:3.12-slim` (Python 3.12.16), with source mounted read-only and test stores under container `/tmp`; Python source compilation and diff checks. The container, pulled image and temporary local venv/data were removed. Remote test-zone/token-optimizer MCP are unavailable. No push/deployment.
## Trainer public route — 2026-11-17
- Owner requested `/trainer` instead of `/lu-trainer`. Python and Nginx now expose `/trainer` and `/trainer/`; the homepage link and browser entry URLs use `/trainer`. Internal `web/lu-trainer.html` and `/lu-trainer/` asset URLs are retained. No game mechanics, runtime dependencies or deployment changes.