File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ def test_bust_cache_localhost():
139
139
140
140
def test_bust_cache_production_missing_file ():
141
141
"""Test for cache_bust the path is missing."""
142
- expected = '/ punkcat/nowhere?missing_file'
142
+ expected = 'punkcat/nowhere?missing_file'
143
143
webcompat .app .config ['LOCALHOST' ] = None
144
144
assert bust_cache ('/punkcat/nowhere' ) == expected
145
145
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ def bust_cache(file_path):
30
30
"""
31
31
if app .config ['LOCALHOST' ]:
32
32
return file_path
33
+ if file_path .startswith ('/' ):
34
+ file_path = file_path [1 :]
33
35
absolute_path = os .path .join (STATIC_PATH , file_path )
34
36
return file_path + '?' + get_checksum (absolute_path )
35
37
@@ -41,6 +43,7 @@ def get_checksum(file_path):
41
43
except KeyError :
42
44
checksum = md5_checksum (file_path )
43
45
cache_dict [str (file_path )] = checksum
46
+ print ('GET_CHECKSUM (after cache miss)' , cache_dict )
44
47
return checksum
45
48
46
49
You can’t perform that action at this time.
0 commit comments