[rejected AI] fix: respect per-request body size limits - #477
Closed
KayanoLiam wants to merge 1 commit into
Closed
KayanoLiam wants to merge 1 commit into
KayanoLiam wants to merge 1 commit into
Conversation
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setting
request.max_content_lengthbefore reading a request body now takes effect. Routes can disable the limit withNone, increase it for an upload, or impose a smaller limit without changing the application-wide setting.Check the declared Content-Length when the body is consumed instead of caching a 413 during construction. Keep the body's limit in sync with the request property, and distinguish an explicit
Noneoverride from the default application setting. Streaming without Content-Length retains its existing behavior.Fixes #425.
Validation on Python 3.13.7:
PYTHONPATH=src .venv/bin/python -m pytest -q: 303 passed, including 48 new cases covering buffered reads, streaming, forms, and requests with and without Content-Length.PYTHONPATH=src .venv/bin/python -m mypy: passed.