Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions django/utils/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@ def parse_header_parameters(line, max_length=MAX_HEADER_LENGTH):
if max_length is not None and len(line) > max_length:
raise ValueError("Unable to parse header parameters (value too long).")

# Fast path for no params.
if ";" not in line:
return line.strip().lower(), {}

parts = _parseparam(";" + line)
key = parts.__next__().lower()
pdict = {}
Expand Down
Loading