summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuanzhong Chen <quantum2048@gmail.com>2025-12-17 03:39:03 -0500
committerGitHub <noreply@github.com>2025-12-17 09:39:03 +0100
commit896863802e0d14b1d7003b442a842317a0272b0f (patch)
treeee3f473a2b99c93a4c9af13660e8231cc6488bde
parent920b40253cbd70a8c5332030dab37418a4cc4142 (diff)
[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
-rw-r--r--searx/engines/brave.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/searx/engines/brave.py b/searx/engines/brave.py
index a19046b77..3b8962625 100644
--- a/searx/engines/brave.py
+++ b/searx/engines/brave.py
@@ -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"])