Add test to parse_multipart_form_data() when invalid Content-Disposition

This commit is contained in:
Igor Sobreira 2012-01-24 23:48:54 -02:00
parent 76b002e8e5
commit e5a6037872
1 changed files with 13 additions and 0 deletions

View File

@ -139,6 +139,19 @@ Foo
parse_multipart_form_data(b("1234"), data, args, 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):
def test_multi_line(self):
# Lines beginning with whitespace are appended to the previous line