mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-16 14:03:43 +08:00
feat: Implement Vertex AI support for Anthropic and Google models
This commit is contained in:
@@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user