fix: cap POST /download-zip at 50 documents
From the PR description
Summary
- Adds a
MAX_ZIP_DOCUMENTS = 50constant and a 400 guard toPOST /single-documents/download-zip - Prevents an authenticated user from triggering simultaneous in-memory loading of an unbounded number of large files
Closes #99 Closes #114
Changes
backend/src/routes/documents.ts-MAX_ZIP_DOCUMENTSconstant + length check returning 400backend/src/lib/__tests__/downloadZipLimit.test.ts- static analysis test verifying the limit existsbackend/vitest.config.ts- vitest config scoping tests tosrc/(excludes compileddist/)backend/package.json-"test": "vitest run"script added
Test plan
- Unit tests added and passing
- Backend build passes
Our analysis
Cap zip download bundle at 50 documents — read the full analysis →
Think the analysis missed something the PR description covers?
Capture this PR into my fork
Download a Markdown prompt that tells Claude how to port every
commit in this PR into your working tree. Run it via
claude -p < capture-pull-111.md from
inside the repo you want the changes in.