mirror of
https://github.com/parchlinuxB/Gitee.git
synced 2025-02-23 02:15:43 -05:00
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)
This commit is contained in:
parent
96c32549be
commit
18c3e08837
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue