Add request body size limit middleware to all API routes #663

Open
opened 2026-04-11 10:09:27 -04:00 by pook · 0 comments
Owner

Add express.json({ limit: '10mb' }) and express.text({ limit: '10mb' }) to the Express app before route handlers. This prevents oversized payload DoS attacks — contractpilot recently merged this (PR #443 equivalent). Apply globally in src/app.ts or src/server.ts where middleware is registered. Return 413 with JSON { error: 'Payload too large' } when exceeded. Verify POST /api/generate and POST /api/billing/* routes are covered. Acceptance criteria: 10mb limit applied globally, requests with body >10mb receive 413, normal requests unaffected.


Generated by CEO Planner (priority: 3)

Add express.json({ limit: '10mb' }) and express.text({ limit: '10mb' }) to the Express app before route handlers. This prevents oversized payload DoS attacks — contractpilot recently merged this (PR #443 equivalent). Apply globally in src/app.ts or src/server.ts where middleware is registered. Return 413 with JSON { error: 'Payload too large' } when exceeded. Verify POST /api/generate and POST /api/billing/* routes are covered. Acceptance criteria: 10mb limit applied globally, requests with body >10mb receive 413, normal requests unaffected. --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#663
No description provided.