mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-08-28 09:06:50 +00:00
Small fix for #4207 (still needs JS fix/front end)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user