0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 03:31:04 +01:00

Document filenames in the URL should not be checked

Wagtail should be forgiving with filenames at the end of the URL. These
filenames are to make the URL look nice, and to provide a fallback for
browsers that do not handle the 'Content-Disposition' header filename
component. They should not be validated.
This commit is contained in:
Tim Heap 2015-10-05 13:02:43 +11:00
parent 1d4b79f6aa
commit f7b6f805ec

View File

@ -594,10 +594,15 @@ class TestServeView(TestCase):
response = self.client.get(reverse('wagtaildocs_serve', args=(1000, 'blahblahblah', )))
self.assertEqual(response.status_code, 404)
@unittest.expectedFailure
def test_with_incorrect_filename(self):
"""
Wagtail should be forgiving with filenames at the end of the URL. These
filenames are to make the URL look nice, and to provide a fallback for
browsers that do not handle the 'Content-Disposition' header filename
component. They should not be validated.
"""
response = self.client.get(reverse('wagtaildocs_serve', args=(self.document.id, 'incorrectfilename')))
self.assertEqual(response.status_code, 404)
self.assertEqual(response.status_code, 200)
def clear_sendfile_cache(self):
from wagtail.utils.sendfile import _get_sendfile