Skip to content

Complete HTTP request-limit boundary tests and documentation #1091

Description

@doublewhy

RequestSizeLimitMiddleware already counts ASGI receive chunks before parser dispatch and rejects overflow before appending it to the buffer. Existing tests cover oversized bodies, missing/invalid Content-Length, and early termination of a chunked body. The original claim that limiting occurs only after framework buffering is stale.

Done when

  • Inventory existing cases, then cover under-limit, exact-limit, over-limit, empty, and many-small-chunk bodies with absent and misleading Content-Length.
  • Exercise disconnects and accepted-body delivery; assert overflow returns stable HTTP 413 and the endpoint is never called.
  • Verify rejection audit failure cannot admit the request or disclose internal details.
  • Document which routes are bounded, configuration, counting point, bounded buffering/replay behavior, disconnect behavior, and proxy/server responsibilities.
  • Fix only failures demonstrated by those cases.

Do not promise streaming pass-through: the current adapter buffers accepted bodies within its limit. If streaming behavior must change, define and test that contract explicitly. Reuse the public ASGI boundary and avoid private framework body state. Parent: #8.

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