summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-02-19 14:26:58 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-02-19 14:34:02 +0100
commitc2d9c93b3baf365c42a8ba93d965d404dfb5741d (patch)
treeb602e6efd61b3ee654eee5163dd11e0baf6e13a3 /searx
parent4a28b593c2656e690ce7f0c46dd5a53a0c55b971 (diff)
downloadsearxng-c2d9c93b3baf365c42a8ba93d965d404dfb5741d.tar.gz
searxng-c2d9c93b3baf365c42a8ba93d965d404dfb5741d.zip
[fix] image_proxy: allow HTTP redirects
Without redirects the load of various images will fail when image_proxy is enabled [1]. [1] https://github.com/searxng/searxng/pull/910#issuecomment-1045966577 Suggested-by: @dalf [1] Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rwxr-xr-xsearx/webapp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 5e05f9781..eb08d63d9 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -1132,7 +1132,7 @@ def image_proxy():
'DNT': '1',
}
set_context_network_name('image_proxy')
- resp, stream = http_stream(method='GET', url=url, headers=request_headers)
+ resp, stream = http_stream(method='GET', url=url, headers=request_headers, allow_redirects=True)
content_length = resp.headers.get('Content-Length')
if content_length and content_length.isdigit() and int(content_length) > maximum_size:
return 'Max size', 400