diff --git a/api/middleware.go b/api/middleware.go index e761f50..bfa2c75 100644 --- a/api/middleware.go +++ b/api/middleware.go @@ -18,7 +18,7 @@ const ( func authMiddleware(tokenMaker token.Maker) gin.HandlerFunc { return func(ctx *gin.Context) { authHeader := ctx.GetHeader(authHeaderKey) - if len(authHeader) == 0 { + if authHeader == "" { err := errors.New("authorization header is not provided") ctx.AbortWithStatusJSON(http.StatusUnauthorized, errorResponse(err)) return