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:
committed by
Mariusz Felisiak
parent
678c8dfee4
commit
36db4dd937
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user