summaryrefslogtreecommitdiff
path: root/searx/search
diff options
context:
space:
mode:
Diffstat (limited to 'searx/search')
-rw-r--r--searx/search/checker/impl.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/search/checker/impl.py b/searx/search/checker/impl.py
index 990fd1f6..626aa8ce 100644
--- a/searx/search/checker/impl.py
+++ b/searx/search/checker/impl.py
@@ -85,7 +85,10 @@ def _download_and_check_if_image(image_url: str) -> bool:
})
r = next(stream)
r.close()
- is_image = r.headers["content-type"].startswith('image/')
+ if r.status_code == 200:
+ is_image = r.headers.get('content-type', '').startswith('image/')
+ else:
+ is_image = False
del r
del stream
return is_image