This commit is contained in:
Hk-Gosuto
2024-02-20 14:19:51 +08:00
parent f676aa19af
commit 4e5bd62477
3 changed files with 6 additions and 5 deletions

View File

@@ -180,7 +180,7 @@ export function getHeaders(ignoreHeaders?: boolean) {
};
}
const isAzure = accessStore.provider === ServiceProvider.Azure;
let authHeader = isAzure ? "api-key" : "Authorization";
let authHeader = "Authorization";
const apiKey = isGoogle
? accessStore.googleApiKey
: isAzure
@@ -195,6 +195,7 @@ export function getHeaders(ignoreHeaders?: boolean) {
if (validString(apiKey)) {
authHeader = isGoogle ? "x-goog-api-key" : authHeader;
headers[authHeader] = makeBearer(apiKey);
if (isAzure) headers["api-key"] = makeBearer(apiKey);
} else if (
accessStore.enabledAccessControl() &&
validString(accessStore.accessCode)