summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLéon Tiekötter <leon@tiekoetter.com>2025-09-20 07:54:58 +0200
committerGitHub <noreply@github.com>2025-09-20 07:54:58 +0200
commit57ef342ad11eae84629b9c1e889d2b9aa212efeb (patch)
tree15b7668f5c4696fd02daaa966b97bb44e3d575a6
parent0ce0d957b11e70298ef4c1a0aeefe0d9f72f77ec (diff)
[fix] image proxy: object has no attribute 'status_code' (#5212)
Commit 8f8343d [1] introduced a bug in the network logic of SearXNG where stream requests (such as the one from the image proxy) would fail because a wrapper was returned instead of a response object with the correct attribute. This is just a quick in place fix I implemented to get it working again. It would be better to implement corresponding logic to give stream requests the correct object. [1] https://github.com/searxng/searxng/pull/5204
-rw-r--r--searx/network/network.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/network/network.py b/searx/network/network.py
index c5987bfff..eb53afb7f 100644
--- a/searx/network/network.py
+++ b/searx/network/network.py
@@ -280,9 +280,9 @@ class Network:
client.cookies = httpx.Cookies(cookies)
try:
if stream:
- response = client.stream(method, url, **kwargs)
- else:
- response = await client.request(method, url, **kwargs)
+ return client.stream(method, url, **kwargs)
+
+ response = await client.request(method, url, **kwargs)
if self.is_valid_response(response) or retries <= 0:
return self.patch_response(response, do_raise_for_httperror)
except httpx.RemoteProtocolError as e: