summaryrefslogtreecommitdiff
path: root/django/http/multipartparser.py
diff options
context:
space:
mode:
authorsammiee5311 <sammiee5311@gmail.com>2026-02-16 12:21:03 +0900
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-24 13:44:42 -0500
commite84dc8715e91d51364ba6bda2b2fb07e7a8b750e (patch)
tree60b14a481d6a4745a71354ae5fe0206ee7757f0f /django/http/multipartparser.py
parentacd0bec51366e259b4c2b43e4c09755541cdf560 (diff)
Fixed #36931 -- Handled LookupError in multipart parser for invalid RFC 2231 encoding.
Added LookupError to the except clause so invalid headers are silently skipped, consistent with other malformed header handling.
Diffstat (limited to 'django/http/multipartparser.py')
-rw-r--r--django/http/multipartparser.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/http/multipartparser.py b/django/http/multipartparser.py
index d420c255eb..b834b8b31b 100644
--- a/django/http/multipartparser.py
+++ b/django/http/multipartparser.py
@@ -726,7 +726,7 @@ def parse_boundary_stream(stream, max_header_size):
name = header_name.lower().rstrip(" ")
value, params = parse_header_parameters(value_and_params.lstrip(" "))
params = {k: v.encode() for k, v in params.items()}
- except ValueError: # Invalid header.
+ except (ValueError, LookupError): # Invalid header.
continue
if name == "content-disposition":