diff --git a/main.go b/main.go index 9437d84..765ae17 100644 --- a/main.go +++ b/main.go @@ -29,6 +29,8 @@ func init() { func main() { r := mux.NewRouter() r.Use(BasicAuth) + r.Use(QueryLog) + r.PathPrefix("/").Handler(http.StripPrefix("/", enhancedfileserver.FileServer(http.Dir("./")))) a := fmt.Sprintf("%s:%d", c.Listen, c.Port) @@ -41,7 +43,7 @@ func BasicAuth(next http.Handler) http.Handler { if c.Username != "" && c.Password != "" { user, pass, ok := r.BasicAuth() if !ok || user != c.Username || pass != c.Password { - w.Header().Set("WWW-Authenticate", `Basic realm="mydomain"`) + w.Header().Set("WWW-Authenticate", `Basic realm="mydomains"`) http.Error(w, "Unauthorized", http.StatusUnauthorized) }