mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
return on prefix mismatch
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user