mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
The nginx guard only read the http-level default.conf and the three raw location bodies, so two ways of reintroducing the ROM-corruption bug went undetected. Both were confirmed against the suite before this change, each leaving all seven tests green: - gzip_static added at server scope in the template, with the locations left intact: /library/ and /cache/ inherit it, and a request for Game.nes returns Game.nes.gz's bytes. - gzip_static removed from the fingerprinted-assets regex location, which the parametrised list never covered, silently dropping precompressed bundles. Parse the template's location blocks instead, honouring braces inside the quoted regex matcher, and assert against server scope, each build-output location including the regex one, and any location that gains the directive. A prefix match would have let /assets/romm/resources/ pass as expected, so matchers resolve exactly and only the regex is keyed by its opening. Also tie MIN_BYTES to nginx's gzip_min_length with a test rather than a comment, cover the "gzip made it bigger" branch that the extension filter kept unreachable, drop an em dash, and correct a comment that claimed every file without a .gz sibling is gzipped on the fly, which is untrue for types outside gzip_types. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HDXxq3vAxJVGhm1pQuK8V7