fix: 1. anthropic client using common getHeaders; 2. always using Authorization header send access code

This commit is contained in:
lloydzhou
2024-07-01 10:24:19 +00:00
parent d65ddead11
commit 37e2517dac
2 changed files with 4 additions and 26 deletions

View File

@@ -184,7 +184,8 @@ export function getHeaders() {
accessStore.enabledAccessControl() &&
validString(accessStore.accessCode)
) {
headers[authHeader] = makeBearer(
// access_code must send with header named `Authorization`, will using in auth middleware.
headers['Authorization'] = makeBearer(
ACCESS_CODE_PREFIX + accessStore.accessCode,
);
}