1
0
forked from ScoDoc/ScoDoc

disable cache for logos objects

This commit is contained in:
Jean-Marie Place 2021-12-11 17:20:34 +01:00
parent 8a5c4b5ced
commit 4f8f327cb6

View File

@ -30,6 +30,7 @@ Module main: page d'accueil, avec liste des départements
Emmanuel Viennet, 2021
"""
import datetime
import io
import wtforms.validators
@ -231,7 +232,11 @@ def _return_logo(name="header", dept_id="", small=False, strict: bool = True):
stream.seek(0)
return send_file(stream, mimetype=f"image/{fmt}")
else:
return send_file(logo.filepath, mimetype=f"image/{suffix}")
return send_file(
logo.filepath,
mimetype=f"image/{suffix}",
last_modified=datetime.datetime.now(),
)
else:
abort(404)