1
0
Эх сурвалжийг харах

修复登录验证可能的越界问题

Signed-off-by: allan716 <[email protected]>
allan716 3 жил өмнө
parent
commit
e40faeb883

+ 1 - 1
internal/backend/middle/auth.go

@@ -14,7 +14,7 @@ func CheckAuth() gin.HandlerFunc {
 
 	return func(context *gin.Context) {
 		authHeader := context.Request.Header.Get("Authorization")
-		if len(authHeader) <= 1 {
+		if len(authHeader) != 2 {
 			context.JSON(http.StatusUnauthorized, backend.ReplyCheckAuth{Message: "Request Header Authorization Error"})
 			context.Abort()
 			return