mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
* fix: confine provider media paths to the rom's own folders
Media paths in ScreenScraper and LaunchBox metadata sent through
PUT /api/roms/{id} are now kept only when they point at a PNG or video
file in the rom's own folder for that media type. Malformed provider
metadata is rejected with a 422.
nginx serves /assets/romm/resources/ with nosniff and a sandbox CSP,
except for PDFs, so the browser's PDF viewer still opens them.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix: code-review pass on media path confinement
Reject non-string media URLs with a 422, limit stored media file names
to [A-Za-z0-9_-]{1,64}, build the LaunchBox path test from the fixture
rom's ids, and trim the new docstring and nginx comment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor: simplify pass on media path confinement
Raise the 422 directly instead of through a self-caught TypeError, pull
the path check into a predicate, and share the media I/O patches between
the new tests through a class fixture.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: keep only stored media URLs from raw provider metadata
A media URL in client-supplied ScreenScraper or LaunchBox metadata is
kept only when the rom's stored metadata for that provider already holds
it. Otherwise the URL key, or the whole later-disc entry, is dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>