From 18c3e088374b997352cf5856fdddb6d89b6fef14 Mon Sep 17 00:00:00 2001 From: Lucki Date: Sun, 5 Jan 2025 21:54:04 +0100 Subject: 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=`, or by including the `X-API-Key: ` header with the request.](https://wallhaven.cc/help/api) --- searx/engines/wallhaven.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3-54-g00ecf