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.
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
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.