Skip to content

fix(server): actually wire up JSON_BODY_LIMIT (follow-up to #46)#47

Merged
CryptoJones merged 1 commit into
masterfrom
fix/json-body-limit-actually-apply-it
May 17, 2026
Merged

fix(server): actually wire up JSON_BODY_LIMIT (follow-up to #46)#47
CryptoJones merged 1 commit into
masterfrom
fix/json-body-limit-actually-apply-it

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Follow-up to #46. That PR claimed to make the JSON body limit explicit + env-tunable, but only the test file made it into the commit — the server.js change got dropped (uncommitted working-tree state lost during a mid-session reset --hard). This wires the actual change in:

app.use(express.json({ limit: process.env.JSON_BODY_LIMIT || '100kb' }));

Tests: 24 files / 167 passing.

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

#46 landed the test but the server.js change was dropped from the
commit (uncommitted working-tree state got reset away mid-session
before I noticed). This applies the actual server.js change so
the env var has somewhere to plug in.

  app.use(express.json({ limit: process.env.JSON_BODY_LIMIT || '100kb' }));

The test in tests/api/body-size-limit.test.js mounts its own
express.json({limit:'1kb'}) for ergonomics — it covers the parser
behavior server.js depends on without trying to mutate
process.env at test-time (vitest's ESM module cache makes env
flipping fragile). The test header now says so explicitly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 424083a into master May 17, 2026
2 of 3 checks passed
@CryptoJones CryptoJones deleted the fix/json-body-limit-actually-apply-it branch May 17, 2026 23:42
CryptoJones added a commit that referenced this pull request May 17, 2026
)

Continues the housekeeping pattern of #44 — keep the README endpoint
table and CHANGELOG \`[Unreleased]\` in sync with merged PRs.

README:
  - Append rows for the four PurchaseOrder/Inventory entities
    that gained endpoints in #50, #51, #52.

CHANGELOG (under \`[Unreleased]\`):
  - PurchaseOrder + Inventory API rollout (the tracker, #49, and
    its three PRs)
  - JSON_BODY_LIMIT env hook (#45 / #46 / #47)
  - npm audit fix + dep bumps + Snyk PR triage (#30 / #48)

Co-authored-by: Aaron K. Clark <akclark@thenetwerk.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant