This commit is contained in:
ryanhex53
2024-12-24 08:41:17 +08:00
committed by GitHub
13 changed files with 424 additions and 23 deletions

View File

@@ -317,7 +317,14 @@ export function getHeaders(ignoreHeaders: boolean = false) {
if (bearerToken) {
headers[authHeader] = bearerToken;
} else if (isEnabledAccessControl && validString(accessStore.accessCode)) {
}
// ensure access code is being sent when access control is enabled,
// this will fix an issue where the access code is not being sent when provider is google, azure or anthropic
if (
isEnabledAccessControl &&
validString(accessStore.accessCode) &&
authHeader !== "Authorization"
) {
headers["Authorization"] = getBearerToken(
ACCESS_CODE_PREFIX + accessStore.accessCode,
);