Browse Source

[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>
Markus Heiser 3 years ago
parent
commit
c2d9c93b3b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      searx/webapp.py

+ 1 - 1
searx/webapp.py

@@ -1132,7 +1132,7 @@ def image_proxy():
             'DNT': '1',
             'DNT': '1',
         }
         }
         set_context_network_name('image_proxy')
         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')
         content_length = resp.headers.get('Content-Length')
         if content_length and content_length.isdigit() and int(content_length) > maximum_size:
         if content_length and content_length.isdigit() and int(content_length) > maximum_size:
             return 'Max size', 400
             return 'Max size', 400