mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-07-11 02:00:24 +00:00
d0917f2b24
Two issues caught by the PR's own tests against the out-of-process test server: 1. Dedup reporting bug: after a filename collision the file was correctly written to e.g. report-1.pdf, but the JSON response reported the ORIGINAL name (safe_name) — now reports dest.name. (Real user-facing bug.) 2. Zip-bomb cap was untestable: the test monkeypatched _MAX_EXTRACTED_BYTES in the pytest process, which has no effect on the separate server process where extraction runs. Made the cap env-configurable (HERMES_WEBUI_MAX_EXTRACTED_MB, read at call time via _max_extracted_bytes(); defaults to 10x upload cap), set it to 5MB in the conftest server env, and rewrote the test to upload a compressible archive that genuinely extracts past the cap. Also asserts no partial extraction dir is left behind. Plus lint: unused field_name loop var -> _field_name, unused os import in test.