mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-09 19:56:44 -05:00
return on prefix mismatch
This commit is contained in:
parent
1cb3ee5f6d
commit
9f8f420ed3
@ -69,6 +69,7 @@ func (r *restfulService) TokenAuthMiddleware() gin.HandlerFunc {
|
||||
if !strings.HasPrefix(auth, prefix) {
|
||||
c.JSON(http.StatusUnauthorized, "unauthorized")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
auth = strings.TrimPrefix(auth, prefix)
|
||||
if auth != r.config.AuthToken { // tip: Bearer: token123
|
||||
|
Loading…
Reference in New Issue
Block a user