From 853ace7d83424f85d903f6ffe2352bf41f86b7ce Mon Sep 17 00:00:00 2001 From: jfriedli Date: Fri, 8 May 2020 09:10:18 -0700 Subject: Resolve "Fuzzing Errors /api/upload" --- test/test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/test.py') diff --git a/test/test.py b/test/test.py index 2d09662..7431881 100644 --- a/test/test.py +++ b/test/test.py @@ -179,6 +179,18 @@ class Mat2WebTestCase(TestCase): self.assertIn(b'.mp2', rv.data) self.assertEqual(rv.status_code, 200) + def test_get_upload_naughty_input(self): + rv = self.client.post( + '/', + data=dict( + file=(io.BytesIO(b"a"), '﷽'), + ), + follow_redirects=True + ) + self.assertEqual(rv.status_code, 200) + self.assertIn(b'Invalid Filename', rv.data) + + if __name__ == '__main__': unittest.main() -- cgit v1.3