Skip to content

fix: Increase request body size limit for file uploads - #428

Open
Strehk wants to merge 1 commit into
mainfrom
claude/form-validation-error-o1ymmi
Open

fix: Increase request body size limit for file uploads#428
Strehk wants to merge 1 commit into
mainfrom
claude/form-validation-error-o1ymmi

Conversation

@Strehk

@Strehk Strehk commented Jul 17, 2026

Copy link
Copy Markdown
Member

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: Added BODY_SIZE_LIMIT configuration option with documentation explaining:

    • Default behavior (512K limit enforced by adapter-node)
    • Why the limit needs to be raised (multi-MB document uploads)
    • Accepted format (K/M/G suffixes, "Infinity" to disable)
    • Note that this only affects production builds (not Vite dev server)
  • Dockerfile: Set ENV BODY_SIZE_LIMIT=64M as the production default to ensure file uploads work out-of-the-box while remaining overridable at runtime via environment variables

Implementation Details

  • The limit is only enforced by adapter-node in production builds; the Vite dev server is unaffected
  • 64M was chosen as a reasonable default that accommodates multiple large PDFs per upload while remaining conservative
  • The setting is fully documented and can be adjusted per deployment via environment variables

https://claude.ai/code/session_018FeiSjMv4pDn6p81zqPYqP

Summary by CodeRabbit

  • New Features

    • Added configuration for request body size limits.
    • Increased the default limit to support larger document and image uploads.
    • Added guidance for customizing the limit, including supported units and disabling the limit.
  • Documentation

    • Documented when request size limits apply and how oversized requests may result in HTTP 413 errors.

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
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The environment template now documents BODY_SIZE_LIMIT, including units, defaults, and disabling the limit. The Dockerfile sets the runtime default to 64M and documents overriding it.

Changes

Request Body Size Configuration

Layer / File(s) Summary
Configure request body size limit
.env.example, Dockerfile
The environment template documents BODY_SIZE_LIMIT behavior, while the Dockerfile sets a default of 64M and explains runtime overrides.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 7 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Pr Label Required ❓ Inconclusive Repo workflow requires a release label, but this checkout has no GitHub PR label metadata to verify whether one is applied. Provide the PR’s applied labels or a GitHub PR screenshot/metadata. The workspace only shows label requirements, not the actual label state.
✅ Passed checks (7 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Boy Scout Scope ✅ Passed Only .env.example and Dockerfile were changed, both directly implement BODY_SIZE_LIMIT; no unrelated refactor or extra scope appeared.
German Gender-Inclusive Language ✅ Passed messages/de.json ist in diesem PR nicht geändert; nur .env.example und Dockerfile wurden angepasst.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: raising the request body size limit to support file uploads.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/form-validation-error-o1ymmi

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Strehk Strehk changed the title Increase request body size limit for file uploads fix: Increase request body size limit for file uploads Jul 17, 2026
@Strehk Strehk added the PR: Bug Something isn't working label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants