From 75fedffa54ebc88e76910439c35f4ad0ab67b5b2 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Mon, 18 Jan 2021 21:01:00 -0700 Subject: [PATCH] s/validate/authenticate/g --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a551688..75a349a 100644 --- a/main.go +++ b/main.go @@ -85,7 +85,7 @@ func init() { } } -func validate(user string, pass string) bool { +func authenticate(user string, pass string) bool { htpass, exists := users[user] if !exists { @@ -134,7 +134,7 @@ func main() { })) mux.HandleFunc(davPath, func(w http.ResponseWriter, r *http.Request) { user, pass, ok := r.BasicAuth() - if !(ok && validate(user, pass)) { + if !(ok && authenticate(user, pass)) { w.Header().Set("WWW-Authenticate", `Basic realm="davfs"`) http.Error(w, "Unauthorized", http.StatusUnauthorized) return