1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-28 18:25:23 +00:00

return on prefix mismatch

This commit is contained in:
Shelikhoo 2021-09-06 14:16:21 +01:00
parent 1cb3ee5f6d
commit 9f8f420ed3
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -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