Skip to content

fix(gateway): reject invalid and oversized JSON bodies#237

Open
YOMXXX wants to merge 1 commit into
TencentCloud:mainfrom
YOMXXX:fix/gateway-json-body-errors
Open

fix(gateway): reject invalid and oversized JSON bodies#237
YOMXXX wants to merge 1 commit into
TencentCloud:mainfrom
YOMXXX:fix/gateway-json-body-errors

Conversation

@YOMXXX

@YOMXXX YOMXXX commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • return HTTP 400 for malformed JSON request bodies instead of treating them as server errors
  • cap gateway JSON request bodies at 8 MiB using both Content-Length and streamed byte counting
  • add gateway regression tests for malformed and oversized request bodies

Test plan

  • npx vitest run src/gateway
  • npm test
  • npm run build

Notes

  • npm run test:cc-plugin -- --run currently fails because package.json has no test:cc-plugin script.

Signed-off-by: 李冠辰 <liguanchen@xiaomi.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