add missing www-authentication header on failed authentication

This commit is contained in:
David Christofas
2022-08-10 23:59:33 +02:00
parent d271ae2451
commit 32f68f91ff

View File

@@ -87,6 +87,7 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle
}
}
if !isPublicPath(r.URL.Path) {
writeSupportedAuthenticateHeader(w, r)
for _, s := range SupportedAuthStrategies {
userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, s)
}
@@ -178,6 +179,7 @@ func userAgentAuthenticateLockIn(w http.ResponseWriter, r *http.Request, locks m
for _, r := range ProxyWwwAuthenticate {
evalRequestURI(u, r)
}
fmt.Println(w.Header())
}
func evalRequestURI(l userAgentLocker, r regexp.Regexp) {