Skip to content

fix: limit in-memory upload size and return 413 on oversized files#9064

Open
clarboncy wants to merge 1 commit into
SecureBananaLabs:mainfrom
clarboncy:fix/upload-413
Open

fix: limit in-memory upload size and return 413 on oversized files#9064
clarboncy wants to merge 1 commit into
SecureBananaLabs:mainfrom
clarboncy:fix/upload-413

Conversation

@clarboncy

Copy link
Copy Markdown

Summary

Upload route now enforces a 10 MB file size limit via Multer. Oversized uploads return HTTP 413 instead of falling through to the generic 500 handler.

Changes

  • apps/api/src/routes/uploadRoutes.js: Added limits: { fileSize: 10 * 1024 * 1024 } to Multer config.
  • apps/api/src/middleware/errorHandler.js: Added LIMIT_FILE_SIZE error check returning 413.

Acceptance Criteria

  • Bounded file size limit (10 MB)
  • Multer file-size errors mapped to HTTP 413
  • Small uploads still accepted

Closes #9055

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limit in-memory upload size and return 413 on oversized files (clarboncy)

1 participant