upgrade 2.4.0: support grafana
This commit is contained in:
parent
3c1c43ae9c
commit
834669bf36
2
control
2
control
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# release version
|
||||
version=2.3.0
|
||||
version=2.4.0
|
||||
|
||||
CWD=$(cd $(dirname $0)/; pwd)
|
||||
cd $CWD
|
||||
|
|
|
@ -70,13 +70,11 @@ func headerUser(c *gin.Context) string {
|
|||
return pair[0]
|
||||
}
|
||||
|
||||
const internalToken = "monapi-builtin-token"
|
||||
|
||||
// CheckHeaderToken check thirdparty x-srv-token
|
||||
func CheckHeaderToken() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
token := c.GetHeader("x-srv-token")
|
||||
if token != internalToken && !slice.ContainsString(config.Get().Tokens, token) {
|
||||
if !slice.ContainsString(config.Get().Tokens, token) {
|
||||
errors.Bomb("token[%s] invalid", token)
|
||||
}
|
||||
c.Next()
|
||||
|
|
Loading…
Reference in New Issue