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.
See1ef0c0349eBackport of93cedc82f2from main
This commit is contained in:
committed by
Mariusz Felisiak
parent
962d594742
commit
2f974e3c1e
@@ -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'}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user