diff options
author | Alexandre Flament <alex@al-f.net> | 2022-01-22 19:29:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-22 19:29:29 +0100 |
commit | 382f4f8fb081699fc3a3d8d7b1ee7546156506fa (patch) | |
tree | fbbf1b38a4e5685c1bfc4ffa62789361bbacacc8 | |
parent | f01ddd19327cc017fe3f813868c7f20da3831edb (diff) | |
parent | 5439dd5fb1ec0dbfbfef30e042f969b7fb8d66fa (diff) | |
download | searxng-382f4f8fb081699fc3a3d8d7b1ee7546156506fa.tar.gz searxng-382f4f8fb081699fc3a3d8d7b1ee7546156506fa.zip |
Merge pull request #801 from dalf/fix-checker
[fix] checker: fix image fetch
-rw-r--r-- | searx/search/checker/impl.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/searx/search/checker/impl.py b/searx/search/checker/impl.py index c0dd966d0..bc5cdf968 100644 --- a/searx/search/checker/impl.py +++ b/searx/search/checker/impl.py @@ -74,7 +74,7 @@ def _download_and_check_if_image(image_url: str) -> bool: try: # use "image_proxy" (avoid HTTP/2) network.set_context_network_name('image_proxy') - stream = network.stream( + r, stream = network.stream( 'GET', image_url, timeout=10.0, @@ -91,7 +91,6 @@ def _download_and_check_if_image(image_url: str) -> bool: 'Cache-Control': 'max-age=0', }, ) - r = next(stream) r.close() if r.status_code == 200: is_image = r.headers.get('content-type', '').startswith('image/') |