summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucki <Lucki@holarse.de>2025-01-05 21:54:04 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-01-06 12:25:33 +0100
commit18c3e088374b997352cf5856fdddb6d89b6fef14 (patch)
treeca525b27e036421a61cfc8ac92025ec8d18e1936
parent96c32549bef1de19a98a9c19a8983f46e4425e73 (diff)
downloadsearxng-18c3e088374b997352cf5856fdddb6d89b6fef14.tar.gz
searxng-18c3e088374b997352cf5856fdddb6d89b6fef14.zip
Fix usage of `api_key` engine setting
The value of `params['api_key']` isn't read anywhere. Writing directly into the header object solves this quite easily though. > [Users can authenticate by including their API key either in a request URL by appending `?apikey=<API KEY>`, or by including the `X-API-Key: <API KEY>` header with the request.](https://wallhaven.cc/help/api)
-rw-r--r--searx/engines/wallhaven.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/engines/wallhaven.py b/searx/engines/wallhaven.py
index 127873d5d..4ab83a562 100644
--- a/searx/engines/wallhaven.py
+++ b/searx/engines/wallhaven.py
@@ -57,7 +57,7 @@ def request(query, params):
}
if api_key:
- params['api_key'] = api_key
+ params['headers']['X-API-Key'] = api_key
params['url'] = f"{base_url}/api/v1/search?{urlencode(args)}"
return params