[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:
Brock Vojkovic
2026-09-16 22:23:11 +08:00
committed by GitHub
parent f725cc7936
commit ce19e9fae3

View File

@@ -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():