#1712 Add authorization only if Extras key is set

This commit is contained in:
Cohee 2024-01-18 16:33:02 +02:00
parent e38d66edd0
commit 7d34ed56e6
1 changed files with 6 additions and 3 deletions

View File

@ -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;