#1712 Add authorization only if Extras key is set
This commit is contained in:
parent
e38d66edd0
commit
7d34ed56e6
|
@ -167,9 +167,12 @@ async function doExtrasFetch(endpoint, args) {
|
|||
if (!args.headers) {
|
||||
args.headers = {};
|
||||
}
|
||||
Object.assign(args.headers, {
|
||||
'Authorization': `Bearer ${extension_settings.apiKey}`,
|
||||
});
|
||||
|
||||
if (extension_settings.apiKey) {
|
||||
Object.assign(args.headers, {
|
||||
'Authorization': `Bearer ${extension_settings.apiKey}`,
|
||||
});
|
||||
}
|
||||
|
||||
const response = await fetch(endpoint, args);
|
||||
return response;
|
||||
|
|
Loading…
Reference in New Issue