maxParts reaches busboy as limits.parts (src/multipart.ts). While implementing #105 (core #117) we observed that with maxParts: N a multipart body with exactly N parts is rejected with 400 Invalid multipart body, so only N−1 parts are actually accepted. The #105 tests only assert that N+1 parts are rejected, so they don't depend on this boundary.
Expected: N parts accepted and N+1 rejected, matching the option's name and docs.
To do:
Add a boundary test with exactly N parts (route-level and server-level).
Fix the mapping. Either pass maxParts + 1 to busboy, or count the parts ourselves. Check busboy's partsLimit semantics first.
Note the change in the CHANGELOG if the accepted count changes.
`maxParts` reaches busboy as `limits.parts` (`src/multipart.ts`). While implementing #105 (core #117) we observed that with `maxParts: N` a multipart body with **exactly N** parts is rejected with `400 Invalid multipart body`, so only N−1 parts are actually accepted. The #105 tests only assert that N+1 parts are rejected, so they don't depend on this boundary.
Expected: N parts accepted and N+1 rejected, matching the option's name and docs.
To do:
- Add a boundary test with exactly N parts (route-level and server-level).
- Fix the mapping. Either pass `maxParts + 1` to busboy, or count the parts ourselves. Check busboy's `partsLimit` semantics first.
- Note the change in the CHANGELOG if the accepted count changes.
Fixed in 26.11.0-rc.1 (5536093). From the changelog:
maxParts: N accepts exactly N parts (#118). busboy signals its parts limit once the count reaches it, so a body of exactly maxParts parts was rejected with 400 Invalid multipart body and only N−1 got through. busboy now gets one part of headroom, the same way fieldSize does: N parts are accepted and N+1 are rejected, as the option's name says. Both the route-level and the server-level maxParts were affected, on the Node server and app.fetch alike.
Fixed in **26.11.0-rc.1** (`5536093`). From the changelog:
- **`maxParts: N` accepts exactly N parts** (#118). busboy signals its parts limit once the count reaches it, so a body of exactly `maxParts` parts was rejected with `400 Invalid multipart body` and only N−1 got through. busboy now gets one part of headroom, the same way `fieldSize` does: N parts are accepted and N+1 are rejected, as the option's name says. Both the route-level and the server-level `maxParts` were affected, on the Node server and `app.fetch` alike.
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.
maxPartsreaches busboy aslimits.parts(src/multipart.ts). While implementing #105 (core #117) we observed that withmaxParts: Na multipart body with exactly N parts is rejected with400 Invalid multipart body, so only N−1 parts are actually accepted. The #105 tests only assert that N+1 parts are rejected, so they don't depend on this boundary.Expected: N parts accepted and N+1 rejected, matching the option's name and docs.
To do:
maxParts + 1to busboy, or count the parts ourselves. Check busboy'spartsLimitsemantics first.Fixed in 26.11.0-rc.1 (
5536093). From the changelog:maxParts: Naccepts exactly N parts (#118). busboy signals its parts limit once the count reaches it, so a body of exactlymaxPartsparts was rejected with400 Invalid multipart bodyand only N−1 got through. busboy now gets one part of headroom, the same wayfieldSizedoes: N parts are accepted and N+1 are rejected, as the option's name says. Both the route-level and the server-levelmaxPartswere affected, on the Node server andapp.fetchalike.