diff options
Diffstat (limited to 'django/utils/http.py')
| -rw-r--r-- | django/utils/http.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/utils/http.py b/django/utils/http.py index 2950f3e695..f72f54e958 100644 --- a/django/utils/http.py +++ b/django/utils/http.py @@ -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 = {} |
