Skip to content

Resolves #1884: fixes oversized JSON request handling so 413 responses do not throw#1872

Merged
jdaigneau5 merged 2 commits into
devfrom
dr_oversized_json_fix
Jun 30, 2026
Merged

Resolves #1884: fixes oversized JSON request handling so 413 responses do not throw#1872
jdaigneau5 merged 2 commits into
devfrom
dr_oversized_json_fix

Conversation

@david-rocca

@david-rocca david-rocca commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Closes #1884

Summary

Fixes the oversized JSON error handler by removing an undefined variable reference and adds regression coverage for over-limit JSON requests.

Important Changes

src/middleware/middleware.js

  • Updated the 413 handler to call error.recordTooLarge() without arguments.

test/integration-tests/middleware/jsonSyntaxTest.js

  • Added an oversized JSON request regression test.
  • Added a malformed JSON assertion to confirm existing 400 behavior remains unchanged.

Testing

Steps to manually test updated functionality, if possible

  • 1) Run bash -i -c "npm run test:integration".
  • 2) Confirm oversized JSON requests return 413 with RECORD_TOO_LARGE.
  • 3) Confirm malformed JSON requests still return 400 with INVALID_JSON_SYNTAX.

@david-rocca david-rocca changed the title Dr oversized json fix fixes oversized JSON request handling so 413 responses do not throw Jun 25, 2026
@jdaigneau5 jdaigneau5 changed the title fixes oversized JSON request handling so 413 responses do not throw Resolves #1884: fixes oversized JSON request handling so 413 responses do not throw Jun 26, 2026
@jdaigneau5 jdaigneau5 merged commit caa4f6f into dev Jun 30, 2026
9 checks passed
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.

Oversized JSON requests break the 413 handler

2 participants