Repository navigation
fix(storage): Allow uploads above 6 MiB - #472
Merged
Merged
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
Node's http.Server cuts off any request that takes longer than its requestTimeout of 300 s to receive, which caps a single-request upload at about 375 MB on a 10 Mbit/s link. adapter-node does not expose it, so the container now starts server.js, which wraps build/index.js and sets requestTimeout from REQUEST_TIMEOUT (default 3600 in the image).
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.
Fixes #385
Docs
Release note
Checklist
Author
Reviewer
Acceptance