feat: 支持从 x-goog-api-key header 中获取授权密钥
This commit is contained in:
@@ -189,6 +189,11 @@ func TokenAuth() func(c *gin.Context) {
|
|||||||
if skKey != "" {
|
if skKey != "" {
|
||||||
c.Request.Header.Set("Authorization", "Bearer "+skKey)
|
c.Request.Header.Set("Authorization", "Bearer "+skKey)
|
||||||
}
|
}
|
||||||
|
// 从x-goog-api-key header中获取key
|
||||||
|
xGoogKey := c.Request.Header.Get("x-goog-api-key")
|
||||||
|
if xGoogKey != "" {
|
||||||
|
c.Request.Header.Set("Authorization", "Bearer "+xGoogKey)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
key := c.Request.Header.Get("Authorization")
|
key := c.Request.Header.Get("Authorization")
|
||||||
parts := make([]string, 0)
|
parts := make([]string, 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user