From 3a96a11f3a1f2092f2b450965082396b4f5b549a Mon Sep 17 00:00:00 2001 From: David Lord Date: Fri, 25 Oct 2024 15:22:04 -0700 Subject: [PATCH] check max_form_memory_size is set before comparing --- CHANGES.rst | 2 ++ src/quart/formparser.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 4d1a1de..2ad511b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,8 @@ 0.19.8 ------ +* Bugfix Fix missing check that caused the previous fix to raise an error. #366 + 0.19.7 2024-10-25 ----------------- diff --git a/src/quart/formparser.py b/src/quart/formparser.py index b8b0e52..8b0c0ab 100644 --- a/src/quart/formparser.py +++ b/src/quart/formparser.py @@ -190,7 +190,7 @@ async def parse( container = self.start_file_streaming(event, content_length) _write = container.write elif isinstance(event, Data): - if field_size is not None: + if self.max_form_memory_size is not None and field_size is not None: field_size += len(event.data) if field_size > self.max_form_memory_size: