summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-06-28 09:27:03 +0200
committerGitHub <noreply@github.com>2022-06-28 09:27:03 +0200
commitbff5c114be2b7a3fbc735c232abcc6ad4db89a9d (patch)
tree08cb2491171be98ed3fad130c46199d9075637dc /django/http
parent9cf2564d38751a46a71fd322cc08bda717f452a4 (diff)
downloaddjango-bff5c114be2b7a3fbc735c232abcc6ad4db89a9d.tar.gz
Removed unnecessary _parse_header() from MultiPartParser.
Reraising ValueError was unused since its introduction in d725cc9734272f867d41f7236235c28b3931a1b2.
Diffstat (limited to 'django/http')
-rw-r--r--django/http/multipartparser.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/django/http/multipartparser.py b/django/http/multipartparser.py
index e70875a8df..73ef074744 100644
--- a/django/http/multipartparser.py
+++ b/django/http/multipartparser.py
@@ -655,14 +655,6 @@ def parse_boundary_stream(stream, max_header_size):
# the payload.
header_end = chunk.find(b"\r\n\r\n")
- def _parse_header(line):
- main_value_pair, params = parse_header(line)
- try:
- name, value = main_value_pair.split(":", 1)
- except ValueError:
- raise ValueError("Invalid header: %r" % line)
- return name, (value, params)
-
if header_end == -1:
# we find no header, so we just mark this fact and pass on
# the stream verbatim
@@ -683,8 +675,9 @@ def parse_boundary_stream(stream, max_header_size):
# This terminology ("main value" and "dictionary of
# parameters") is from the Python docs.
try:
- name, (value, params) = _parse_header(line)
- except ValueError:
+ main_value_pair, params = parse_header(line)
+ name, value = main_value_pair.split(":", 1)
+ except ValueError: # Invalid header.
continue
if name == "content-disposition":