diff --git a/net/http/auth.go b/net/http/auth.go index 29c1851..7068ef8 100644 --- a/net/http/auth.go +++ b/net/http/auth.go @@ -20,7 +20,7 @@ func BasicAuth(h http.Handler, htpasswd map[string]string, realm string) http.Ha user, pass, _ := r.BasicAuth() if pw, ok := htpasswd[user]; !ok || !strings.EqualFold(pass, sha1(pw)) { w.Header().Set("WWW-Authenticate", rlm) - http.Error(w, "Unauthorized", 401) + http.Error(w, "Unauthorized", http.StatusUnauthorized) return } h.ServeHTTP(w, r)