Skip to content

Commit

Permalink
Fix use of chunk_size parameter (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnstrk committed Apr 18, 2024
1 parent b5a5c19 commit 3a722ed
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 3a722ed

Please sign in to comment.