mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -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) {
|
if !strings.HasPrefix(auth, prefix) {
|
||||||
c.JSON(http.StatusUnauthorized, "unauthorized")
|
c.JSON(http.StatusUnauthorized, "unauthorized")
|
||||||
c.Abort()
|
c.Abort()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
auth = strings.TrimPrefix(auth, prefix)
|
auth = strings.TrimPrefix(auth, prefix)
|
||||||
if auth != r.config.AuthToken { // tip: Bearer: token123
|
if auth != r.config.AuthToken { // tip: Bearer: token123
|
||||||
|
Loading…
Reference in New Issue
Block a user