Skip to content

docs: clarify multipart bodyLimit is not an aggregate limit - #645

Merged
Tony133 merged 2 commits into
mainfrom
docs/multipart-bodylimit
Sep 21, 2026
Merged

Tony133 merged 2 commits into
mainfrom
docs/multipart-bodylimit

Conversation

@mcollina

Copy link
Copy Markdown
Member

Summary

Document that @fastify/multipart does not enforce Fastify's aggregate bodyLimit for multipart requests.

Multipart payloads are parsed by a dedicated streaming parser and bypass Fastify's bodyLimit enforcement. bodyLimit is only used to compute the default fileSize; it is not enforced as an aggregate limit across the whole request. This is intentional (streaming) but was undocumented, and the old README text (fileSize defaulting to 1048576) was misleading because that value only holds when bodyLimit is the Fastify default.

Changes

  • README: replace the stale "1000 and 1048576" default note, and add an explicit caveat that bodyLimit is not an aggregate limit and is not applied at the route level.
  • types: note that limits.fileSize defaults to the Fastify bodyLimit.

This is a documentation-only change, no runtime behavior.

Ref: GHSA-3pm6-wjfr-3v47

Multipart requests are parsed by a dedicated streaming parser and bypass
Fastify's bodyLimit enforcement. bodyLimit is only used to derive the
per-file fileSize default and is not applied as an aggregate limit across
the whole multipart payload. Document this and recommend explicit
fieldSize/fields/files/parts/fileSize limits.

Ref: GHSA-3pm6-wjfr-3v47
@Tony133

Tony133 commented Sep 21, 2026

Copy link
Copy Markdown
Member

CI all green 🙌 ✅

@Tony133 Tony133 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Tony133
Tony133 merged commit 57bbbc5 into main Sep 21, 2026
20 checks passed
@Tony133
Tony133 deleted the docs/multipart-bodylimit branch September 21, 2026 12:51
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.

2 participants