Skip to content

fix(runtime): enforce request limits before body buffering #1091

Description

@doublewhy

Problem

The control-plane request-size limit runs after framework buffering. A chunked request can use unbounded memory before rejection, so API-404 cannot claim bounded ingress.

Done when

  • Count delivered bytes at the public ASGI receive boundary before application buffering; reject overflow with a stable HTTP 413 response.
  • The limit works without Content-Length, with a false length, and with chunked bodies under, at, or over the limit.
  • Tests cover many small chunks, zero-length bodies, disconnects, unchanged normal streaming, and that the endpoint is never called after overflow.
  • Docs state bounded routes, configuration, counting point, 413 response, and proxy expectations.

Avoid private Starlette body state and NOSONAR suppression. Parent: #8. Current implementation: #1086.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions