Skip to content

Limit the request body kept for logging - #214

Open
Mzack9999 wants to merge 1 commit into
devfrom
bounded-request-dump
Open

Mzack9999 wants to merge 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.

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