parseMultipart created busboy with limits: { parts } only, so
busboy's fieldSize default of 1 MiB applied whatever maxBodyBytes
allowed. busboy cuts a field at that size and only sets valueTruncated, which nothing read: with the body limit raised, a
1,100,000-character field reached the handler as 1,048,576 characters.
acquireBody now passes the route's resolved body limit down as maxFieldBytes, and parseMultipart gives it to busboy as fieldSize.
busboy flags a field once it reaches fieldSize, so it gets one byte
of headroom; otherwise a field of exactly the limit would count as
cut. A field that busboy still reports as truncated rejects with
HttpError 413, which parseRequestBody already renders with that
status, matching how an over-limit body fails. Node and app.fetch
(Deno, Bun, edge) share this path.
test/multipart-http.test.ts sends a 1,100,000-character field to a
route with maxBodyBytes 2,000,000 over both app.fetch and the Node
server. test/multipart.test.ts checks the 413 and the exact-limit
boundary on parseMultipart directly.
parseMultipart created busboy with `limits: { parts }` only, so
busboy's `fieldSize` default of 1 MiB applied whatever maxBodyBytes
allowed. busboy cuts a field at that size and only sets
`valueTruncated`, which nothing read: with the body limit raised, a
1,100,000-character field reached the handler as 1,048,576 characters.
acquireBody now passes the route's resolved body limit down as
`maxFieldBytes`, and parseMultipart gives it to busboy as `fieldSize`.
busboy flags a field once it reaches `fieldSize`, so it gets one byte
of headroom; otherwise a field of exactly the limit would count as
cut. A field that busboy still reports as truncated rejects with
HttpError 413, which parseRequestBody already renders with that
status, matching how an over-limit body fails. Node and app.fetch
(Deno, Bun, edge) share this path.
test/multipart-http.test.ts sends a 1,100,000-character field to a
route with maxBodyBytes 2,000,000 over both app.fetch and the Node
server. test/multipart.test.ts checks the 413 and the exact-limit
boundary on parseMultipart directly.
parseMultipart created busboy with `limits: { parts }` only, so
busboy's `fieldSize` default of 1 MiB applied whatever maxBodyBytes
allowed. busboy cuts a field at that size and only sets
`valueTruncated`, which nothing read: with the body limit raised, a
1,100,000-character field reached the handler as 1,048,576 characters.
acquireBody now passes the route's resolved body limit down as
`maxFieldBytes`, and parseMultipart gives it to busboy as `fieldSize`.
busboy flags a field once it reaches `fieldSize`, so it gets one byte
of headroom; otherwise a field of exactly the limit would count as
cut. A field that busboy still reports as truncated rejects with
HttpError 413, which parseRequestBody already renders with that
status, matching how an over-limit body fails. Node and app.fetch
(Deno, Bun, edge) share this path.
test/multipart-http.test.ts sends a 1,100,000-character field to a
route with maxBodyBytes 2,000,000 over both app.fetch and the Node
server. test/multipart.test.ts checks the 413 and the exact-limit
boundary on parseMultipart directly.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
parseMultipart created busboy with
limits: { parts }only, sobusboy's
fieldSizedefault of 1 MiB applied whatever maxBodyBytesallowed. busboy cuts a field at that size and only sets
valueTruncated, which nothing read: with the body limit raised, a1,100,000-character field reached the handler as 1,048,576 characters.
acquireBody now passes the route's resolved body limit down as
maxFieldBytes, and parseMultipart gives it to busboy asfieldSize.busboy flags a field once it reaches
fieldSize, so it gets one byteof headroom; otherwise a field of exactly the limit would count as
cut. A field that busboy still reports as truncated rejects with
HttpError 413, which parseRequestBody already renders with that
status, matching how an over-limit body fails. Node and app.fetch
(Deno, Bun, edge) share this path.
test/multipart-http.test.ts sends a 1,100,000-character field to a
route with maxBodyBytes 2,000,000 over both app.fetch and the Node
server. test/multipart.test.ts checks the 413 and the exact-limit
boundary on parseMultipart directly.
parseMultipart created busboy with `limits: { parts }` only, so busboy's `fieldSize` default of 1 MiB applied whatever maxBodyBytes allowed. busboy cuts a field at that size and only sets `valueTruncated`, which nothing read: with the body limit raised, a 1,100,000-character field reached the handler as 1,048,576 characters. acquireBody now passes the route's resolved body limit down as `maxFieldBytes`, and parseMultipart gives it to busboy as `fieldSize`. busboy flags a field once it reaches `fieldSize`, so it gets one byte of headroom; otherwise a field of exactly the limit would count as cut. A field that busboy still reports as truncated rejects with HttpError 413, which parseRequestBody already renders with that status, matching how an over-limit body fails. Node and app.fetch (Deno, Bun, edge) share this path. test/multipart-http.test.ts sends a 1,100,000-character field to a route with maxBodyBytes 2,000,000 over both app.fetch and the Node server. test/multipart.test.ts checks the 413 and the exact-limit boundary on parseMultipart directly. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>23ab4f4122to235e483bfb