From 4e5bd6247707e3bb550e7097dfb8cc3d3fe19729 Mon Sep 17 00:00:00 2001 From: Hk-Gosuto Date: Tue, 20 Feb 2024 14:19:51 +0800 Subject: [PATCH] fix: #198 --- app/client/api.ts | 3 ++- app/components/settings.tsx | 4 ++-- app/store/access.ts | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/client/api.ts b/app/client/api.ts index 736f2a670..19f4aa53f 100644 --- a/app/client/api.ts +++ b/app/client/api.ts @@ -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) diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 17bb60759..69c5556d2 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -1053,7 +1053,7 @@ export function Settings() { accessStore.update( (access) => @@ -1112,7 +1112,7 @@ export function Settings() { accessStore.update( (access) => diff --git a/app/store/access.ts b/app/store/access.ts index 18d91fe28..63aaf3330 100644 --- a/app/store/access.ts +++ b/app/store/access.ts @@ -29,7 +29,7 @@ const DEFAULT_ACCESS_STATE = { // azure azureUrl: "", azureApiKey: "", - azureApiVersion: "2023-08-01-preview", + azureApiVersion: "2024-02-15-preview", // google ai studio googleBaseUrl: "", @@ -114,7 +114,7 @@ export const useAccessStore = createPersistStore( googleApiKey: string; }; state.openaiApiKey = state.token; - state.azureApiVersion = "2023-08-01-preview"; + state.azureApiVersion = "2024-02-15-preview"; state.googleApiKey = state.token; }