diff --git a/.gitignore b/.gitignore index 2e36f7a8..888c7bbe 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ node_modules /uploads/ .local/ .parcel-cache +.vscode diff --git a/jazzband/content.py b/jazzband/content.py index 251ebc9d..13e34edc 100644 --- a/jazzband/content.py +++ b/jazzband/content.py @@ -64,13 +64,11 @@ def securitytxt_redirect(): @content.route("/.well-known/security.txt") def securitytxt_file(): - filename = "security.txt" return send_from_directory( current_app.static_folder, - filename, + "security.txt", as_attachment=False, mimetype="text/plain", - max_age=current_app.get_send_file_max_age(filename), ) @@ -167,12 +165,8 @@ def index(): @content.route("/favicon.ico") def favicon(): - filename = "favicon.ico" - cache_timeout = current_app.get_send_file_max_age(filename) - favicon_path = safe_join(current_app.static_folder, "favicons") return send_from_directory( - favicon_path, - filename, + safe_join(current_app.static_folder, "favicons"), + "favicon.ico", mimetype="image/vnd.microsoft.icon", - cache_timeout=cache_timeout, ) diff --git a/jazzband/projects/views.py b/jazzband/projects/views.py index 7b498013..8167666d 100644 --- a/jazzband/projects/views.py +++ b/jazzband/projects/views.py @@ -409,15 +409,15 @@ class UploadDownloadView(UploadMembersActionView): methods = ["GET"] def get(self, name, upload_id): - cache_timeout = current_app.get_send_file_max_age(self.upload.full_path) + max_age = current_app.get_send_file_max_age(self.upload.full_path) path, filename = os.path.split(self.upload.full_path) return send_from_directory( path, filename, - cache_timeout=cache_timeout, + max_age=max_age, as_attachment=True, - attachment_filename=self.upload.filename, - add_etags=False, + download_name=self.upload.filename, + etag=False, conditional=True, )