From 74fbef4ae80d50ee6ee28b262fd171ab0a9ebdef Mon Sep 17 00:00:00 2001 From: Bennett Wetters Date: Sat, 25 Jul 2026 21:09:33 +0200 Subject: [PATCH] refactor(handlers): Use http.Header.Set instead of direct map access --- handlers/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/util.go b/handlers/util.go index 27c2d9f..d7e6dd5 100644 --- a/handlers/util.go +++ b/handlers/util.go @@ -18,7 +18,7 @@ func updateEndpointValidator( // Check BasicAuth credentials username, password, ok := r.BasicAuth() if !ok || !util.CheckCredentials(authDB, validCredentials, username, password) { - w.Header()["WWW-Authenticate"] = []string{"Basic realm=\"spaceapid\""} + w.Header().Set("WWW-Authenticate", "Basic realm=\"spaceapid\"") http.Error(w, "", http.StatusUnauthorized) return []byte{}, errors.New(fmt.Sprintf("Unauthorized request from %s Username: %s Password: %s", r.RemoteAddr, username, password)) }