Merge pull request #2425 from atopos31/main
This commit is contained in:
commit
bd2f7750db
@ -195,8 +195,8 @@ func TokenAuth() func(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
c.Request.Header.Set("Authorization", "Bearer "+key)
|
c.Request.Header.Set("Authorization", "Bearer "+key)
|
||||||
}
|
}
|
||||||
// 检查path包含/v1/messages
|
// 检查path包含/v1/messages 或 /v1/models
|
||||||
if strings.Contains(c.Request.URL.Path, "/v1/messages") {
|
if strings.Contains(c.Request.URL.Path, "/v1/messages") || strings.Contains(c.Request.URL.Path, "/v1/models") {
|
||||||
anthropicKey := c.Request.Header.Get("x-api-key")
|
anthropicKey := c.Request.Header.Get("x-api-key")
|
||||||
if anthropicKey != "" {
|
if anthropicKey != "" {
|
||||||
c.Request.Header.Set("Authorization", "Bearer "+anthropicKey)
|
c.Request.Header.Set("Authorization", "Bearer "+anthropicKey)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user