fix(snapshots): ignore images with no content-type from server

This commit is contained in:
Iain Learmonth 2026-06-18 09:41:32 +01:00
parent b4df8218ff
commit f5b6843968

View file

@ -74,6 +74,8 @@ def fetch_url(base: str, url: str) -> str | None:
if len(content) > 2_500_000: if len(content) > 2_500_000:
return None return None
content_type = response.headers.get("Content-Type", "") content_type = response.headers.get("Content-Type", "")
if content_type == "":
return None
return encode_data_uri(content, content_type) return encode_data_uri(content, content_type)
except requests.exceptions.RequestException: except requests.exceptions.RequestException:
return None return None