Skip to content

Commit 3cfb6c9

Browse files
committed
fix(auth): add x_webauth_user to hook context
1 parent 6a2cf96 commit 3cfb6c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/middleware/authn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const xWebAuthUser = "X-WebAuth-User"
1212
func AuthN(authenticator auth.Authenticator) Middleware {
1313
return func(next http.Handler) http.Handler {
1414
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
15-
w.Header().Del(xWebAuthUser)
15+
r.Header.Del(xWebAuthUser)
1616
if ok, username := authenticator.Validate(r); ok {
17-
w.Header().Set(xWebAuthUser, username)
17+
r.Header.Set(xWebAuthUser, username)
1818
next.ServeHTTP(w, r)
1919
return
2020
}

0 commit comments

Comments
 (0)