fix: Increase request body size limit for file uploads - #428
Open
Strehk wants to merge 1 commit into
Open
Conversation
adapter-node caps request bodies at 512K by default and rejects larger requests with HTTP 413 before they reach the SvelteKit action. Conference base PDF and image uploads exceed this, so uploading a certificate/document template failed on the deployed site even though the Zod schema permits up to 10MB per file. Set BODY_SIZE_LIMIT=64M in the production image and document the variable in .env.example. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018FeiSjMv4pDn6p81zqPYqP
Contributor
📝 WalkthroughWalkthroughThe environment template now documents ChangesRequest Body Size Configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 7 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (7 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Increases the default request body size limit from 512K to 64M to accommodate conference document and image uploads that can exceed the default adapter-node limit.
Problem
The adapter-node runtime caps request bodies at 512K by default and rejects larger payloads with HTTP 413 before they reach the application. This silently breaks file uploads for conference base PDFs and images, which can be several MB in size. The Zod schema validates base PDFs up to 10MB each, and a single save operation may include multiple documents.
Changes
.env.example: AddedBODY_SIZE_LIMITconfiguration option with documentation explaining:Dockerfile: SetENV BODY_SIZE_LIMIT=64Mas the production default to ensure file uploads work out-of-the-box while remaining overridable at runtime via environment variablesImplementation Details
https://claude.ai/code/session_018FeiSjMv4pDn6p81zqPYqP
Summary by CodeRabbit
New Features
Documentation