Repository navigation
fix(storage): Allow uploads above 6 MiB - #472
Open
Bohreromir wants to merge 1 commit into
Open
Bohreromir wants to merge 1 commit into
Bohreromir wants to merge 1 commit into
Conversation
The storage browser uploads each file in a single request, so the image's BODY_SIZE_LIMIT of 6M capped uploads at 6 MiB. Raise it to 5G; the upload endpoint streams the body to S3, so this does not grow server memory. A new hook limits all other routes, most of which buffer the body, to max(6 MiB, editable file size + 1 MiB) by Content-Length, before better-auth or any handler reads it. Bodies without Content-Length are rejected with 411. A body above BODY_SIZE_LIMIT now answers the upload with 413 instead of 502, and the upload modal says the file is too large. Document the matching ingress-nginx body limit.
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bohreromir
marked this pull request as ready for review
November 16, 2026 15:17
labrenbe
self-requested a review
November 16, 2026 15:55
labrenbe
requested changes
Nov 16, 2026
| # buffer the body, are limited to max(6 MiB, editable file size + 1 MiB) by | ||
| # src/lib/server/request-body-limit.ts. The E2E app reads this value from here | ||
| # (e2e/support/body-size-limit.ts). | ||
| ENV BODY_SIZE_LIMIT=5G |
Member
There was a problem hiding this comment.
We should probably increase the request timeout for uploads or large uploads might time out after 5 min.
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.
Description
The storage browser uploads each file in a single request, so the image's BODY_SIZE_LIMIT of 6M capped uploads at 6 MiB. Raise it to 5G; the upload endpoint streams the body to S3, so this does not grow server memory.
A new hook limits all other routes, most of which buffer the body, to max(6 MiB, editable file size + 1 MiB) by Content-Length, before better-auth or any handler reads it. Bodies without Content-Length are rejected with 411.
A body above BODY_SIZE_LIMIT now answers the upload with 413 instead of 502, and the upload modal says the file is too large. Document the matching ingress-nginx body limit.
Docs
Release note
Checklist
Author
Reviewer
Acceptance