From b4df8218ffdbeea1b419061f19045d934df00c33 Mon Sep 17 00:00:00 2001 From: irl Date: Thu, 18 Jun 2026 09:40:57 +0100 Subject: [PATCH 1/2] feat(snapshots): increase max image size to 2.5M --- src/snapshots/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/snapshots/client.py b/src/snapshots/client.py index 5461cc2..4e6dbca 100644 --- a/src/snapshots/client.py +++ b/src/snapshots/client.py @@ -64,14 +64,14 @@ def fetch_url(base: str, url: str) -> str | None: content_length = response.headers.get("Content-Length") if content_length is not None: try: - if int(content_length) > 500_000: + if int(content_length) > 2_500_000: return None except ValueError: pass # Invalid Content-Length format, proceed to stream content = b"" for chunk in response.iter_content(chunk_size=1024): content += chunk - if len(content) > 500_000: + if len(content) > 2_500_000: return None content_type = response.headers.get("Content-Type", "") return encode_data_uri(content, content_type) From f5b68439686eec7f5a904574fa9cacf54cec3015 Mon Sep 17 00:00:00 2001 From: irl Date: Thu, 18 Jun 2026 09:41:32 +0100 Subject: [PATCH 2/2] fix(snapshots): ignore images with no content-type from server --- src/snapshots/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/snapshots/client.py b/src/snapshots/client.py index 4e6dbca..3c1a337 100644 --- a/src/snapshots/client.py +++ b/src/snapshots/client.py @@ -74,6 +74,8 @@ def fetch_url(base: str, url: str) -> str | None: if len(content) > 2_500_000: return None content_type = response.headers.get("Content-Type", "") + if content_type == "": + return None return encode_data_uri(content, content_type) except requests.exceptions.RequestException: return None