summaryrefslogtreecommitdiff
path: root/tests/test_static.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_static.py')
-rw-r--r--tests/test_static.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_static.py b/tests/test_static.py
index af487fa24..97978f2a4 100644
--- a/tests/test_static.py
+++ b/tests/test_static.py
@@ -104,6 +104,19 @@ class Test_static_view_use_subpath_False(unittest.TestCase):
self.assertRaises(HTTPNotFound, inst, context, request)
+ def test_oob_nul_char(self):
+ import os
+
+ inst = self._makeOne(f'{os.getcwd()}/tests/fixtures/static')
+ dds = '..\x00/'
+ request = self._makeRequest(
+ {'PATH_INFO': f'/{dds}'}
+ )
+ context = DummyContext()
+ from pyramid.httpexceptions import HTTPNotFound
+
+ self.assertRaises(HTTPNotFound, inst, context, request)
+
def test_resource_doesnt_exist(self):
inst = self._makeOne('tests:fixtures/static')
request = self._makeRequest({'PATH_INFO': '/notthere'})