summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <mmerickel@users.noreply.github.com>2016-11-15 20:56:14 -0600
committerGitHub <noreply@github.com>2016-11-15 20:56:14 -0600
commitb1a4a241b85c1f9c71ffacf213f1e1aa8669861b (patch)
treed01ddc031502b3d8886ec9a12d420c3cd65a4a0c
parentc151adb1ee83eb34005a9883e748831e2b79de21 (diff)
parent3e2a692f4ee839d6c17850b51af9501a4d074a03 (diff)
downloadpyramid-b1a4a241b85c1f9c71ffacf213f1e1aa8669861b.tar.gz
pyramid-b1a4a241b85c1f9c71ffacf213f1e1aa8669861b.tar.bz2
pyramid-b1a4a241b85c1f9c71ffacf213f1e1aa8669861b.zip
Merge pull request #2681 from Pylons/cleanup/cachebust_match
Remove cachebust_match
-rw-r--r--pyramid/static.py5
-rw-r--r--pyramid/tests/test_static.py8
2 files changed, 1 insertions, 12 deletions
diff --git a/pyramid/static.py b/pyramid/static.py
index 31e500e70..a8088129e 100644
--- a/pyramid/static.py
+++ b/pyramid/static.py
@@ -88,7 +88,7 @@ class static_view(object):
"""
def __init__(self, root_dir, cache_max_age=3600, package_name=None,
- use_subpath=False, index='index.html', cachebust_match=None):
+ use_subpath=False, index='index.html'):
# package_name is for bw compat; it is preferred to pass in a
# package-relative path as root_dir
# (e.g. ``anotherpackage:foo/static``).
@@ -101,15 +101,12 @@ class static_view(object):
self.docroot = docroot
self.norm_docroot = normcase(normpath(docroot))
self.index = index
- self.cachebust_match = cachebust_match
def __call__(self, context, request):
if self.use_subpath:
path_tuple = request.subpath
else:
path_tuple = traversal_path_info(request.environ['PATH_INFO'])
- if self.cachebust_match:
- path_tuple = self.cachebust_match(path_tuple)
path = _secure_path(path_tuple)
if path is None:
diff --git a/pyramid/tests/test_static.py b/pyramid/tests/test_static.py
index 2b200d72b..f76cc5067 100644
--- a/pyramid/tests/test_static.py
+++ b/pyramid/tests/test_static.py
@@ -113,14 +113,6 @@ class Test_static_view_use_subpath_False(unittest.TestCase):
response = inst(context, request)
self.assertTrue(b'<html>static</html>' in response.body)
- def test_cachebust_match(self):
- inst = self._makeOne('pyramid.tests:fixtures/static')
- inst.cachebust_match = lambda subpath: subpath[1:]
- request = self._makeRequest({'PATH_INFO':'/foo/index.html'})
- context = DummyContext()
- response = inst(context, request)
- self.assertTrue(b'<html>static</html>' in response.body)
-
def test_resource_is_file_with_wsgi_file_wrapper(self):
from pyramid.response import _BLOCK_SIZE
inst = self._makeOne('pyramid.tests:fixtures/static')