From: Igor Sobreira Date: Wed, 25 Jan 2012 02:14:17 +0000 (-0200) Subject: Add test to parse_multipart_form_data() when line does not end with the correct line... X-Git-Tag: v2.3.0~105^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97009a380eca35b4c2e1246fcd9ca46ebc3382b4;p=thirdparty%2Ftornado.git Add test to parse_multipart_form_data() when line does not end with the correct line break (\r\n) --- diff --git a/tornado/test/httputil_test.py b/tornado/test/httputil_test.py index 2755c5b12..00f5d16b9 100644 --- a/tornado/test/httputil_test.py +++ b/tornado/test/httputil_test.py @@ -151,6 +151,17 @@ Foo parse_multipart_form_data(b("1234"), data, args, files) self.assertEqual(files, {}) + def test_line_does_not_end_with_correct_line_break(self): + data = b('''\ +--1234 +Content-Disposition: form-data; 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):