Skip to content

Limit the request body kept for logging - #214

Merged
dwisiswant0 merged 1 commit into
devfrom
bounded-request-dump
Nov 2, 2026
Merged

dwisiswant0 merged 1 commit into
devfrom
bounded-request-dump

Conversation

@Mzack9999

Copy link
Copy Markdown
Member

Closes #213

Proposed changes

  • The logging layer keeps at most -max-dump-body-size of the request body (1 MB when the flag is not set). The limit no longer depends on Content-Length, so chunked bodies are bounded too.
  • The bytes read for the log are put back in front of the body, so handlers still read the full request.
  • The body is read only when a log output needs it (verbose or JSON log).

Proof

New tests TestLogLayerBoundsChunkedBody and TestLogLayerSkipsBodyWithoutLog. Existing tests pass.

@dwisiswant0 dwisiswant0 linked an issue Nov 2, 2026 that may be closed by this pull request
@dwisiswant0
dwisiswant0 merged commit 4a5c07f into dev Nov 2, 2026
5 checks passed
@dwisiswant0
dwisiswant0 deleted the bounded-request-dump branch November 2, 2026 17:53
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.

Request logging reads chunked bodies fully into memory

2 participants