fix max age when file is a stream

This commit is contained in:
ziirish 2017-01-26 14:54:13 +01:00
parent caef8604df
commit b6ff7b148e

View file

@ -375,11 +375,12 @@ class BUIServer(Flask):
def get_send_file_max_age(self, name):
"""Provides default cache_timeout for the send_file() functions."""
lname = name.lower()
extensions = ['js', 'css', 'woff']
for ext in extensions:
if lname.endswith('.{}'.format(ext)):
return 3600 * 24 * 30 # 30 days
if name:
lname = name.lower()
extensions = ['js', 'css', 'woff']
for ext in extensions:
if lname.endswith('.{}'.format(ext)):
return 3600 * 24 * 30 # 30 days
return Flask.get_send_file_max_age(self, name)
def manual_run(self):