mirror of
https://0xacab.org/jvoisin/mat2-web.git
synced 2025-05-13 03:32:18 -04:00
Resolve "Fuzzing Errors /api/upload"
This commit is contained in:
parent
9157dee69f
commit
853ace7d83
5 changed files with 46 additions and 5 deletions
12
test/test.py
12
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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue