mirror of
https://github.com/amir20/dozzle.git
synced 2026-01-02 19:17:37 +01:00
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user