From cec24fe2c16b4b17aaf17eb04a83fa68fe71bebe Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sat, 12 Feb 2022 18:22:11 +0100 Subject: [PATCH] Check if 'application/json; charset=utf-8' --- changedetectionio/fetch_site_status.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changedetectionio/fetch_site_status.py b/changedetectionio/fetch_site_status.py index bf24df12..da1941de 100644 --- a/changedetectionio/fetch_site_status.py +++ b/changedetectionio/fetch_site_status.py @@ -106,8 +106,10 @@ class perform_site_check(): # https://stackoverflow.com/questions/41817578/basic-method-chaining ? # return content().textfilter().jsonextract().checksumcompare() ? update_obj['content-type'] = fetcher.headers.get('Content-Type', '').lower().strip() + + # Could be 'application/json; charset=utf-8' etc + is_json = 'application/json' in update_obj['content-type'] - is_json = update_obj['content-type'] == 'application/json' is_text_or_html = 'text' in update_obj['content-type'] is_binary = content_fetcher.supported_binary_type(update_obj['content-type'])