支持Anthropic端点客户端x-api-key:\n- /v1/messages读取x-api-key并优先作为客户端授权传递\n- getAnthropicHeaders转发x-api-key并透传anthropic-version\n- CORS允许X-API-Key与anthropic-version
This commit is contained in:
@@ -12,7 +12,7 @@ app.use(express.urlencoded({ extended: true, limit: '50mb' }));
|
||||
app.use((req, res, next) => {
|
||||
res.header('Access-Control-Allow-Origin', '*');
|
||||
res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
||||
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
|
||||
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-API-Key, anthropic-version');
|
||||
|
||||
if (req.method === 'OPTIONS') {
|
||||
return res.sendStatus(200);
|
||||
|
||||
Reference in New Issue
Block a user