Repository navigation
clearer docs about about where request limits apply - #3251
Merged
Merged
Conversation
remove max_form_memory_size check for aplication/x-www-form-urlencoded
davidism
force-pushed
the
request-limits
branch
from
August 21, 2026 04:51
9ed37b2 to
46b89c9
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Add more docs to address the constant stream of invalid security reports about the form parser and max content length.
FormDataParser.parse_from_environorget_input_stream.max_form_memory_sizeandmax_form_partsare additional checks, they do not replace a limited stream andmax_content_length.Requestattr docstrings, andFormDataParserdocstrings._parse_urlencodedexplaining why it doesn't usemax_form_memory_sizeormax_form_parts._parse_urlencodedactually did enforcecontent_length <= max_form_memory_size, which was where a lot of the invalid reports were coming from since they only looked at that and nothing else. That check seems to have been there forever, but it seems to be incorrect.max_form_memory_sizeis formultipart/form-data(and is already dubiously useful for text parts, since they will still all take up memory in the end, which should be limited withmax_content_length). The check here was applied to the entire body as if it wasmax_content_length. We also decided that enforcingmax_form_partsthere didn't make sense. I removed the check.