busboy emits partsLimit once its part count reaches limits.parts,
not when it passes it, and parseMultipart treats that event as a
malformed body. With maxParts: N a body of exactly N parts was
therefore rejected with 400 and only N-1 were accepted.
parseMultipart now passes maxParts + 1 to busboy, the same one-unit
headroom it already gives fieldSize. N parts are accepted, N+1 are
rejected. Route-level and server-level maxParts share this path, as do
the Node server and app.fetch.
test/multipart.test.ts adds the exact-N case on parseMultipart;
test/multipart-http.test.ts sends exactly N parts at route and server
level. All three new assertions fail without the fix.
busboy emits `partsLimit` once its part count reaches `limits.parts`,
not when it passes it, and parseMultipart treats that event as a
malformed body. With `maxParts: N` a body of exactly N parts was
therefore rejected with 400 and only N-1 were accepted.
parseMultipart now passes `maxParts + 1` to busboy, the same one-unit
headroom it already gives `fieldSize`. N parts are accepted, N+1 are
rejected. Route-level and server-level maxParts share this path, as do
the Node server and app.fetch.
test/multipart.test.ts adds the exact-N case on parseMultipart;
test/multipart-http.test.ts sends exactly N parts at route and server
level. All three new assertions fail without the fix.
busboy emits `partsLimit` once its part count reaches `limits.parts`,
not when it passes it, and parseMultipart treats that event as a
malformed body. With `maxParts: N` a body of exactly N parts was
therefore rejected with 400 and only N-1 were accepted.
parseMultipart now passes `maxParts + 1` to busboy, the same one-unit
headroom it already gives `fieldSize`. N parts are accepted, N+1 are
rejected. Route-level and server-level maxParts share this path, as do
the Node server and app.fetch.
test/multipart.test.ts adds the exact-N case on parseMultipart;
test/multipart-http.test.ts sends exactly N parts at route and server
level. All three new assertions fail without the fix.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx
merged commit cf5df70c62 into develop2026-10-25 03:36:04 +00:00
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.
busboy emits
partsLimitonce its part count reacheslimits.parts,not when it passes it, and parseMultipart treats that event as a
malformed body. With
maxParts: Na body of exactly N parts wastherefore rejected with 400 and only N-1 were accepted.
parseMultipart now passes
maxParts + 1to busboy, the same one-unitheadroom it already gives
fieldSize. N parts are accepted, N+1 arerejected. Route-level and server-level maxParts share this path, as do
the Node server and app.fetch.
test/multipart.test.ts adds the exact-N case on parseMultipart;
test/multipart-http.test.ts sends exactly N parts at route and server
level. All three new assertions fail without the fix.