Priority: P2 · Review finding: #11
src/handler.js /api/scans/:id/video cleans the tmpdir on the stream's finish and error events, but not on close — if the client disconnects mid-download, finish never fires and the tmpdir (with the rendered mp4) is leaked.
Fix: also hook res.on('close', ...) (idempotent cleanup), or use stream.pipeline with a finally.
Priority: P2 · Review finding: #11
src/handler.js/api/scans/:id/videocleans the tmpdir on the stream'sfinishanderrorevents, but not onclose— if the client disconnects mid-download,finishnever fires and the tmpdir (with the rendered mp4) is leaked.Fix: also hook
res.on('close', ...)(idempotent cleanup), or usestream.pipelinewith a finally.