Skip to content

Commit

Permalink
Merge pull request #8 from viralparmarme/deepsource-autofix-d7fb9e09
Browse files Browse the repository at this point in the history
refactor: fix check for empty string
  • Loading branch information
viralparmarme authored Sep 29, 2023
2 parents 7e7e6a8 + eda8f73 commit 6a3a407
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a3a407

Please sign in to comment.