Skip to content

Commit

Permalink
Merge pull request #4 from Isidroalex/change_mw
Browse files Browse the repository at this point in the history
Minor changes
  • Loading branch information
spatecon authored Sep 1, 2023
2 parents 0f3db2e + c7abf1d commit c79cae2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/app/mw/mw.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ const roleAdmin = "admin"
func RoleCheck(next echo.HandlerFunc) echo.HandlerFunc {
return func(ctx echo.Context) error {
val := ctx.Request().Header.Get("User-Role")
val = strings.ToLower(val)

if strings.EqualFold(val, roleAdmin) {
if strings.Contains(val, roleAdmin) {
log.Println("red button user detected")
}

Expand Down
1 change: 0 additions & 1 deletion internal/pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package app

import (
"fmt"
"log"

"github.com/labstack/echo/v4"

Expand Down

0 comments on commit c79cae2

Please sign in to comment.