mirror of
https://github.com/searxng/searxng.git
synced 2024-12-27 11:40:29 +00:00
[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>
This commit is contained in:
parent
4a28b593c2
commit
c2d9c93b3b
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue