1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[4.1.x] Refs #33697 -- Fixed multipart parsing of headers with double quotes and semicolons.

See 1ef0c0349e

Backport of 93cedc82f2 from main
This commit is contained in:
Mehrdad
2022-05-27 13:18:06 -04:00
committed by Mariusz Felisiak
parent 962d594742
commit 2f974e3c1e
2 changed files with 7 additions and 1 deletions

View File

@@ -944,3 +944,9 @@ class MultiParserTests(SimpleTestCase):
for raw_line, expected_title in test_data:
parsed = parse_header(raw_line)
self.assertEqual(parsed[1]["title"], expected_title)
def test_parse_header_with_double_quotes_and_semicolon(self):
self.assertEqual(
parse_header(b'form-data; name="files"; filename="fo\\"o;bar"'),
("form-data", {"name": b"files", "filename": b'fo"o;bar'}),
)