Small fix for #4207 (still needs JS fix/front end)

This commit is contained in:
dgtlmoon
2026-06-01 17:24:10 +02:00
parent f4079b605b
commit 3106067e66
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -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
+4
View File
@@ -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