From 3106067e66bed65230e551f1db269d4e09129276 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 1 Jun 2026 17:24:10 +0200 Subject: [PATCH] Small fix for #4207 (still needs JS fix/front end) --- changedetectionio/api/Watch.py | 3 +++ changedetectionio/flask_app.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/changedetectionio/api/Watch.py b/changedetectionio/api/Watch.py index 9f5d0c82..5acc626f 100644 --- a/changedetectionio/api/Watch.py +++ b/changedetectionio/api/Watch.py @@ -447,6 +447,9 @@ class WatchFavicon(Resource): # Use cached MIME type detection filepath = os.path.join(watch.data_dir, favicon_filename) mime = get_favicon_mime_type(filepath) + if 'text' in mime: + logger.debug(f"Aborting favicon request for {filepath} because mimetype might be text (bad mimetype) '{mime}'") + abort(404) response = make_response(send_from_directory(watch.data_dir, favicon_filename)) response.headers['Content-type'] = mime diff --git a/changedetectionio/flask_app.py b/changedetectionio/flask_app.py index b1b1b0de..f8155f85 100644 --- a/changedetectionio/flask_app.py +++ b/changedetectionio/flask_app.py @@ -789,7 +789,11 @@ def changedetection_app(config=None, datastore_o=None): if favicon_filename: # Use cached MIME type detection filepath = os.path.join(watch.data_dir, favicon_filename) + mime = get_favicon_mime_type(filepath) + if 'text' in mime: + logger.debug(f"Aborting favicon request for {filename} because mimetype might be text (bad mimetype) '{mime}'") + abort(404) response = make_response(send_from_directory(watch.data_dir, favicon_filename)) response.headers['Content-type'] = mime