Skip to content

Commit c79cae2

Browse files
authored
Merge pull request #4 from Isidroalex/change_mw
Minor changes
2 parents 0f3db2e + c7abf1d commit c79cae2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/app/mw/mw.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ const roleAdmin = "admin"
1212
func RoleCheck(next echo.HandlerFunc) echo.HandlerFunc {
1313
return func(ctx echo.Context) error {
1414
val := ctx.Request().Header.Get("User-Role")
15+
val = strings.ToLower(val)
1516

16-
if strings.EqualFold(val, roleAdmin) {
17+
if strings.Contains(val, roleAdmin) {
1718
log.Println("red button user detected")
1819
}
1920

internal/pkg/app/app.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package app
22

33
import (
44
"fmt"
5-
"log"
65

76
"github.com/labstack/echo/v4"
87

0 commit comments

Comments
 (0)