Add test to parse_multipart_form_data() when invalid Content-Disposition
This commit is contained in:
parent
76b002e8e5
commit
e5a6037872
|
@ -139,6 +139,19 @@ Foo
|
||||||
parse_multipart_form_data(b("1234"), data, args, files)
|
parse_multipart_form_data(b("1234"), data, args, files)
|
||||||
self.assertEqual(files, {})
|
self.assertEqual(files, {})
|
||||||
|
|
||||||
|
def test_invalid_content_disposition(self):
|
||||||
|
data = b('''\
|
||||||
|
--1234
|
||||||
|
Content-Disposition: invalid; name="files"; filename="ab.txt"
|
||||||
|
|
||||||
|
Foo
|
||||||
|
--1234--''').replace(b("\n"), b("\r\n"))
|
||||||
|
args = {}
|
||||||
|
files = {}
|
||||||
|
parse_multipart_form_data(b("1234"), data, args, files)
|
||||||
|
self.assertEqual(files, {})
|
||||||
|
|
||||||
|
|
||||||
class HTTPHeadersTest(unittest.TestCase):
|
class HTTPHeadersTest(unittest.TestCase):
|
||||||
def test_multi_line(self):
|
def test_multi_line(self):
|
||||||
# Lines beginning with whitespace are appended to the previous line
|
# Lines beginning with whitespace are appended to the previous line
|
||||||
|
|
Loading…
Reference in New Issue