ewwww broke passthrough basic auth

master v0.10.2
Bel LaPointe 2024-04-01 06:45:31 -06:00
parent 87d95b4eff
commit dee04b6962
1 changed files with 1 additions and 1 deletions

View File

@ -158,7 +158,7 @@ func (s *Server) Pre(foo http.HandlerFunc) http.HandlerFunc {
log.Printf("failed to lookup auth for %s (%s): %v", r.Host, mapKey(r.Host), err)
w.Header().Set("WWW-Authenticate", "Basic")
http.Error(w, err.Error(), http.StatusUnauthorized)
} else if _, p, _ := r.BasicAuth(); auth != p {
} else if _, p, _ := r.BasicAuth(); auth != "" && auth != p {
log.Printf("failed to auth: expected %q but got %q", auth, p)
w.Header().Set("WWW-Authenticate", "Basic")
http.Error(w, "unexpected basic auth", http.StatusUnauthorized)