1
0
mirror of https://github.com/amir20/dozzle.git synced 2026-01-02 19:17:37 +01:00

fix: uses username instead of email to validate remote user proxy. see #2598 (#2604)

This commit is contained in:
Amir Raminfar
2023-12-18 08:21:56 -08:00
committed by GitHub
parent 5a4432244c
commit 0db179c312

View File

@@ -31,7 +31,7 @@ func NewForwardProxyAuth() *proxyAuthContext {
func (p *proxyAuthContext) AuthMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get("Remote-Email") != "" {
if r.Header.Get("Remote-User") != "" {
user := newUser(r.Header.Get("Remote-User"), r.Header.Get("Remote-Email"), r.Header.Get("Remote-Name"))
ctx := context.WithValue(r.Context(), remoteUser, user)
next.ServeHTTP(w, r.WithContext(ctx))