Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Hygiene✅ Deterministic PR hygiene checks passed. |
|
Consolidated into #177 as the single main work item. Its checklist now carries this proposal’s requirements and relevant unresolved review concerns. Closing this duplicate tracking item does not mean the combined implementation is finished. The branch and review history are retained. |
Motivation
response.text()for anystatus >= 400, which buffers the entire upstream body and creates a DoS surface for large or never-ending non-JSON error responses.Description
response.text()for all error statuses and restrict full-text inspection toapplication/jsonresponses only by changing the JSON-branch guard tocontentType.includes("application/json")and keeping JSON inspection unchanged.getReader()and aReadableStreamwrapper.MAX_NON_JSON_ERROR_INSPECTION_BYTES = 8192as the byte cap for retained diagnostic data and finalize logging on EOF, read error, or cancellation without buffering the whole body.tests/request-log.test.tsthat assert non-JSON error bodies stream the first chunk immediately and that oversized error bodies are preserved downstream while only a bounded prefix is logged.Testing
bun run typecheckand it completed with no type errors.OCX_TEST_NO_QUEUE=1 bun run test -- tests/request-log.test.tsand the modified request-log suite passed (47 tests).OCX_TEST_NO_QUEUE=1 bun run test) and observed the test run complete with tests passing in this run.bun run privacy:scanwhich passed with no privacy issues detected.