Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of chunk_size parameter #136

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions multipart/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ def parse_form(
# Create our form parser.
parser = create_form_parser(headers, on_field, on_file)

# Read chunks of 100KiB and write to the parser, but never read more than
# Read chunks of 1MiB and write to the parser, but never read more than
# the given Content-Length, if any.
content_length = headers.get("Content-Length")
if content_length is not None:
Expand All @@ -1826,7 +1826,7 @@ def parse_form(

while True:
# Read only up to the Content-Length given.
max_readable = min(content_length - bytes_read, 1048576)
max_readable = min(content_length - bytes_read, chunk_size)
buff = input_stream.read(max_readable)

# Write to the parser and update our length.
Expand Down