From 17c8a41229e9054db33bed88c2bb8d1c046bb902 Mon Sep 17 00:00:00 2001 From: lelo Date: Fri, 30 May 2025 09:47:06 +0000 Subject: [PATCH] cleanup --- app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 4ae4d8b..2d77cdb 100755 --- a/app.py +++ b/app.py @@ -466,7 +466,7 @@ def serve_file(subpath): filesize = os.path.getsize(file_path) # Figure out download flag and filename - ask_download = request.args.get('download') == 'true' + as_attachment = request.args.get('download') == 'true' filename = os.path.basename(full_path) # Single send_file call with proper attachment handling @@ -474,10 +474,10 @@ def serve_file(subpath): file_path, mimetype=mime, conditional=True, - as_attachment=ask_download, - download_name=filename if ask_download else None + as_attachment=as_attachment , + download_name=filename if as_attachment else None ) - if not ask_download: + if not as_attachment : response.headers['Content-Disposition'] = 'inline' response.headers['Cache-Control'] = 'public, max-age=86400'