From 9f8f420ed3707513badfac59e3ba1cc58b92fd8e Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Mon, 6 Sep 2021 14:16:21 +0100 Subject: [PATCH] return on prefix mismatch --- app/restful-api/restful-api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app/restful-api/restful-api.go b/app/restful-api/restful-api.go index 8eedfd994..42180c43d 100644 --- a/app/restful-api/restful-api.go +++ b/app/restful-api/restful-api.go @@ -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