소스 검색

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

Signed-off-by: allan716 <[email protected]>
allan716 3 년 전
부모
커밋
e40faeb883
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      internal/backend/middle/auth.go

+ 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