Skip to content

Commit

Permalink
Use new param names.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Aug 9, 2022
1 parent 4c30a69 commit 3b9d2a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ node_modules
/uploads/
.local/
.parcel-cache
.vscode
12 changes: 3 additions & 9 deletions jazzband/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)


Expand Down Expand Up @@ -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,
)
8 changes: 4 additions & 4 deletions jazzband/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down

0 comments on commit 3b9d2a2

Please sign in to comment.