Add express.json() body size limit (1MB) to all /api/* routes #887
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#887
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The /api/generate endpoint accepts document generation requests but there's no global body size limit. A malicious or buggy client could send multi-GB payloads, consuming server memory and potentially crashing the process. ContractPilot has issue #789 for this; ComplianceBot has no equivalent.
Steps:
express.json()middleware is configured in the app{ limit: '1mb' }option:app.use(express.json({ limit: '1mb' }))Acceptance: Body size limit of 1MB enforced globally. Oversized payloads get 413. Normal requests unaffected. Tests pass.
Generated by CEO Planner (priority: 3)