mirror of
https://github.com/searxng/searxng.git
synced 2026-09-23 14:46:04 +00:00
[fix] image_proxy compressed images (#6730)
Prevents the image proxy from decompressing brotli/gzip in transit. See: https://curl.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html Setting accept_encoding to none prevents curl from automatically decompressing the received contents. Signed-off-by: vojkovic <git@vojk.au>
This commit is contained in:
@@ -201,6 +201,8 @@ def delete(url: str, **kwargs: t.Any) -> SXNG_Response:
|
||||
|
||||
async def stream_chunk_to_queue(network, queue, method: str, url: str, **kwargs: t.Any):
|
||||
try:
|
||||
# prevent curl from decompressing the response https://github.com/searxng/searxng/pull/6730
|
||||
kwargs.setdefault('accept_encoding', None)
|
||||
async with await network.stream(method, url, **kwargs) as response:
|
||||
queue.put(response)
|
||||
async for chunk in response.aiter_content():
|
||||
|
||||
Reference in New Issue
Block a user