We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0f3db2e + c7abf1d commit c79cae2Copy full SHA for c79cae2
internal/app/mw/mw.go
@@ -12,8 +12,9 @@ const roleAdmin = "admin"
12
func RoleCheck(next echo.HandlerFunc) echo.HandlerFunc {
13
return func(ctx echo.Context) error {
14
val := ctx.Request().Header.Get("User-Role")
15
+ val = strings.ToLower(val)
16
- if strings.EqualFold(val, roleAdmin) {
17
+ if strings.Contains(val, roleAdmin) {
18
log.Println("red button user detected")
19
}
20
internal/pkg/app/app.go
@@ -2,7 +2,6 @@ package app
2
3
import (
4
"fmt"
5
- "log"
6
7
"github.com/labstack/echo/v4"
8
0 commit comments