fix basic auth (#564)

* fix basic auth

* better logic
This commit is contained in:
Andrea Spacca 2023-06-06 19:59:21 +09:00 committed by GitHub
parent fc844ac341
commit 45e2654036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1326,7 +1326,7 @@ func ipFilterHandler(h http.Handler, ipFilterOptions *IPFilterOptions) http.Hand
func (s *Server) basicAuthHandler(h http.Handler) http.HandlerFunc { func (s *Server) basicAuthHandler(h http.Handler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
if s.authUser == "" || s.authPass == "" || s.authHtpasswd == "" { if s.authUser == "" && s.authPass == "" && s.authHtpasswd == "" {
h.ServeHTTP(w, r) h.ServeHTTP(w, r)
return return
} }