Browse Source

return on prefix mismatch

Shelikhoo 4 years ago
parent
commit
9f8f420ed3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      app/restful-api/restful-api.go

+ 1 - 0
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