mirror of
https://github.com/codl/forget
synced 2025-01-07 12:52:34 +01:00
cachebust: don't 500 on non-existant files
This commit is contained in:
parent
58fd10977e
commit
fc58833bf5
@ -4,7 +4,10 @@ def cachebust(app):
|
||||
@app.route('/static-<int:timestamp>/<path:filename>')
|
||||
def static_cachebust(timestamp, filename):
|
||||
path = os.path.join(app.static_folder, filename)
|
||||
mtime = os.stat(path).st_mtime
|
||||
try:
|
||||
mtime = os.stat(path).st_mtime
|
||||
except Exception:
|
||||
return abort(404)
|
||||
if abs(mtime - timestamp) > 1:
|
||||
abort(404)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user