From d8ca73ac18cfe9f04fd0559e541385338dc3b620 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Sat, 22 Jun 2019 13:36:45 -0700 Subject: [PATCH] Prevent browser from caching the export (#1033) * Add `cache_timeout` parameter to `send_file`response in `/admin/export` to prevent the browser from caching the export * Closes #1032 --- CTFd/admin/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CTFd/admin/__init__.py b/CTFd/admin/__init__.py index f12465be..8872fe49 100644 --- a/CTFd/admin/__init__.py +++ b/CTFd/admin/__init__.py @@ -110,7 +110,9 @@ def export_ctf(): ctf_name = ctf_config.ctf_name() day = datetime.datetime.now().strftime("%Y-%m-%d") full_name = u"{}.{}.zip".format(ctf_name, day) - return send_file(backup, as_attachment=True, attachment_filename=full_name) + return send_file( + backup, cache_timeout=-1, as_attachment=True, attachment_filename=full_name + ) @admin.route("/admin/export/csv")