mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
In the http block gzip_static was inherited by every location, including the internal /library/ and /cache/ ones that serve downloads. RomM handles .gz and .tar.gz ROMs, so a library holding both Game.nes and Game.nes.gz answered a request for the first with the second's bytes under Content-Encoding: gzip. Reproduced against nginx with a real upstream issuing X-Accel-Redirect: the download returned 73 bytes of gzip instead of the 3000-byte ROM. Clients that do not transparently decode, and Range resumes over /cache/, would have written the wrong file to disk. It now sits in the three locations that serve the frontend build, where a .gz sibling can only be one the build wrote. Verified both directions: the ROM download returns the plain 3000 bytes with no Content-Encoding, and a fingerprinted asset is still served from its precompressed sibling. The test now guards the invariant rather than the directive's presence: gzip_static must be absent from the http block and from every location serving files the build did not produce. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HDXxq3vAxJVGhm1pQuK8V7