feat(snapshots): increase max image size to 2.5M

This commit is contained in:
Iain Learmonth 2026-06-18 09:40:57 +01:00
parent e0ad9ee248
commit b4df8218ff

View file

@ -64,14 +64,14 @@ def fetch_url(base: str, url: str) -> str | None:
content_length = response.headers.get("Content-Length") content_length = response.headers.get("Content-Length")
if content_length is not None: if content_length is not None:
try: try:
if int(content_length) > 500_000: if int(content_length) > 2_500_000:
return None return None
except ValueError: except ValueError:
pass # Invalid Content-Length format, proceed to stream pass # Invalid Content-Length format, proceed to stream
content = b"" content = b""
for chunk in response.iter_content(chunk_size=1024): for chunk in response.iter_content(chunk_size=1024):
content += chunk content += chunk
if len(content) > 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", "")
return encode_data_uri(content, content_type) return encode_data_uri(content, content_type)