[fix] engine: brave - BrotliDecoderDecompressStream encoding issue (#5572)

For some reason, I keep getting this error from the brave engine:

    httpx.DecodingError: BrotliDecoderDecompressStream failed while processing the stream

Forcing the server to use either gzip or deflate fixes this issue.

This makes the brave engine work when the server seems to be encoding brotli incorrectly, or at least in a way incompatible with certain installs.

Related:

- https://github.com/searxng/searxng/pull/1787
- https://github.com/searxng/searxng/pull/5536
This commit is contained in:
Guanzhong Chen
2025-12-17 03:39:03 -05:00
committed by GitHub
parent 920b40253c
commit 896863802e

View File

@@ -214,6 +214,7 @@ def request(query: str, params: dict[str, t.Any]) -> None:
if brave_category == "goggles":
args["goggles_id"] = Goggles
params["headers"]["Accept-Encoding"] = "gzip, deflate"
params["url"] = f"{base_url}{brave_category}?{urlencode(args)}"
logger.debug("url %s", params["url"])