Skip to content

Request logging reads chunked bodies fully into memory #213

Closed

Description

@Mzack9999

simplehttpserver version:

dev

Current Behavior:

The request logging layer decides whether to dump the body from Content-Length. A chunked request has no Content-Length, so its whole body is read into memory for the log, with no size limit. This happens before the request reaches the handler (also before basic auth), and also when no log output needs the body.

Expected Behavior:

The body kept for logging has a size limit (-max-dump-body-size, with a default when it is not set), and the body is read only when a log needs it.

Steps To Reproduce:

  1. Run simplehttpserver -v.
  2. Send a large request with Transfer-Encoding: chunked.

Anything else:

Activity

  1. added
    Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.
    on Oct 29, 2026
  2. linked a pull request that will close this issueLimit the request body kept for logging #214on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions