1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #28132 -- Made MultiPartParser ignore filenames with trailing slash.

This commit is contained in:
Michael Brown
2020-06-08 12:55:27 -04:00
committed by Mariusz Felisiak
parent 678c8dfee4
commit 36db4dd937
3 changed files with 11 additions and 4 deletions

View File

@@ -209,10 +209,14 @@ class FileUploadTests(TestCase):
Receiving file upload when filename is blank (before and after
sanitization) should be okay.
"""
# The second value is normalized to an empty name by
# MultiPartParser.IE_sanitize()
filenames = ['', 'C:\\Windows\\']
filenames = [
'',
# Normalized by MultiPartParser.IE_sanitize().
'C:\\Windows\\',
# Normalized by os.path.basename().
'/',
'ends-with-slash/',
]
payload = client.FakePayload()
for i, name in enumerate(filenames):
payload.write('\r\n'.join([