From 07f41782c0d724c5928a788ec8c6ee7bb0315e9b Mon Sep 17 00:00:00 2001 From: Leigh Morresi <275001+dgtlmoon@users.noreply.github.com> Date: Wed, 3 Feb 2021 09:45:58 +0100 Subject: [PATCH] Adding SEND_FILE_MAX_AGE_DEFAULT to ensure backups etc dont get old --- backend/backend.py | 1 + backend/fetch_site_status.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/backend.py b/backend/backend.py index ec112e80..8da5a4e9 100644 --- a/backend/backend.py +++ b/backend/backend.py @@ -46,6 +46,7 @@ update_q = queue.Queue() app = Flask(__name__, static_url_path='/static') app.config['STATIC_RESOURCES'] = "/app/static" +app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0 # app.config['SECRET_KEY'] = 'secret!' diff --git a/backend/fetch_site_status.py b/backend/fetch_site_status.py index 8a0e35d2..89d6eca9 100644 --- a/backend/fetch_site_status.py +++ b/backend/fetch_site_status.py @@ -34,8 +34,9 @@ class perform_site_check(): os.mkdir(self.output_path) def save_response_html_output(self, output): - # @todo maybe record a history.json, [timestamp, md5, filename] - with open("{}/{}.txt".format(self.output_path, self.timestamp), 'w') as f: + + # @todo Saving the original HTML can be very large, better to set as an option, these files could be important to some. + with open("{}/{}.html".format(self.output_path, self.timestamp), 'w') as f: f.write(output) f.close()