From dee04b6962db081c1b2617c456700ce282c55d67 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Mon, 1 Apr 2024 06:45:31 -0600 Subject: [PATCH] ewwww broke passthrough basic auth --- server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index 6fbf693..92b097b 100755 --- a/server/server.go +++ b/server/server.go @@ -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)