fix(snapshots): ignore images with no content-type from server
This commit is contained in:
parent
b4df8218ff
commit
f5b6843968
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue