Skip to content

Commit 3a722ed

Browse files
authored
Fix use of chunk_size parameter (#136)
1 parent b5a5c19 commit 3a722ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

multipart/multipart.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,7 @@ def parse_form(
18151815
# Create our form parser.
18161816
parser = create_form_parser(headers, on_field, on_file)
18171817

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

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

18321832
# Write to the parser and update our length.

0 commit comments

Comments
 (0)