mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-08 18:23:43 +08:00
修改: .env.template
修改: app/api/auth.ts 修改: app/api/bedrock.ts 修改: app/client/api.ts 修改: app/client/platforms/bedrock.ts 修改: app/components/settings.tsx 修改: app/config/server.ts 修改: app/constant.t
This commit is contained in:
@@ -261,7 +261,7 @@ export function getHeaders(ignoreHeaders: boolean = false) {
|
||||
const apiKey = isGoogle
|
||||
? accessStore.googleApiKey
|
||||
: isBedrock
|
||||
? accessStore.awsAccessKeyId // Use AWS access key for Bedrock
|
||||
? accessStore.awsAccessKey // Use AWS access key for Bedrock
|
||||
: isAzure
|
||||
? accessStore.azureApiKey
|
||||
: isAnthropic
|
||||
@@ -322,12 +322,15 @@ export function getHeaders(ignoreHeaders: boolean = false) {
|
||||
const authHeader = getAuthHeader();
|
||||
|
||||
if (isBedrock) {
|
||||
// Add AWS credentials for Bedrock
|
||||
headers["X-Region"] = accessStore.awsRegion;
|
||||
headers["X-Access-Key"] = accessStore.awsAccessKeyId;
|
||||
headers["X-Secret-Key"] = accessStore.awsSecretAccessKey;
|
||||
// 简单加密 AWS credentials
|
||||
const encrypt = (str: string) =>
|
||||
Buffer.from(str.split("").reverse().join("")).toString("base64");
|
||||
|
||||
headers["X-Region"] = encrypt(accessStore.awsRegion);
|
||||
headers["X-Access-Key"] = encrypt(accessStore.awsAccessKey);
|
||||
headers["X-Secret-Key"] = encrypt(accessStore.awsSecretKey);
|
||||
if (accessStore.awsSessionToken) {
|
||||
headers["X-Session-Token"] = accessStore.awsSessionToken;
|
||||
headers["X-Session-Token"] = encrypt(accessStore.awsSessionToken);
|
||||
}
|
||||
} else {
|
||||
const bearerToken = getBearerToken(
|
||||
|
||||
Reference in New Issue
Block a user