| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
A more generous out-of-the-box request body cap for common workloads
(larger `git push`, media uploads, bigger RDF documents). Still fully
configurable via --body-limit / JSS_BODY_LIMIT / createServer({
bodyLimit }) — deployments wanting tighter memory-DoS protection lower
it.
- config.defaults.bodyLimit: 10 MiB → 20 MiB
- bin/jss.js --body-limit help text: 'default 10MB' → 'default 20MB'
- refreshed two now-stale doc comments that claimed the default
'matches the previous hard-coded 10 MiB cap' (config.js, server.js)
- new regression test pins the EFFECTIVE wired default via Fastify's
initialConfig.bodyLimit (config.defaults → createServer → Fastify),
so the default can't silently drift
Scope note: the tunnel proxy has a SEPARATE 10 MiB WS message cap
(src/tunnel/index.js MAX_MESSAGE_SIZE) that this change does not touch
— a >10 MiB push over a tunnel would clear the body limit but hit
that cap. Out of scope for #563 (request-body default); worth a
follow-up if tunnelled large pushes become a real need.
Full suite: 962/962 passing.
Closes #563.
There was a problem hiding this comment.
Raises the server’s default Fastify request body limit from 10 MiB to 20 MiB, keeping the limit configurable via existing CLI/env/programmatic options and adding a regression test that verifies the effective default is actually wired through to Fastify.
Changes:
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/config.js | Updates the default bodyLimit constant and refreshes explanatory comments. |
| src/server.js | Refreshes the comment describing how bodyLimit falls back to defaults when unset. |
| bin/jss.js | Updates --body-limit help text to reflect the new default. |
| test/body-limit.test.js | Adds a regression test pinning the effective wired default via server.initialConfig. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #563.
What
Raises the out-of-the-box request body cap from 10 MiB to 20 MiB — a more generous default for common workloads (larger git push, media uploads, bigger RDF documents). Still fully configurable; deployments wanting tighter memory-DoS protection lower it via --body-limit / JSS_BODY_LIMIT / createServer({ bodyLimit }).
Test approach
Rather than asserting the config constant in isolation (tautological), the new test pins the default through the whole path — config.defaults.bodyLimit → createServer() → Fastify — by reading Fastify's frozen initialConfig.bodyLimit. So an accidental break anywhere in the wiring (not just a constant edit) trips it.
Scope note (worth a look)
The issue's motivation cites "larger git push over the tunnel", but the tunnel proxy has a separate 10 MiB WS message cap (src/tunnel/index.js MAX_MESSAGE_SIZE) that this PR does not touch. So a >10 MiB push over a tunnel would clear the raised body limit but still hit the tunnel cap. That's out of scope for #563 (which is specifically the request-body parser default) — flagging it as a candidate follow-up if tunnelled large pushes become a real need, rather than silently bumping a second unrelated limit.
Also unchanged: src/utils/url.js MAX_JSON_SIZE (a separate 10 MiB JSON-parse safety cap) — not the request body limit.
Full suite: 962/962 passing.
Refs