--wip-- [skip ci]

This commit is contained in:
Bendodroid 2026-07-21 21:32:49 +02:00
commit 7a8b904852
10 changed files with 282 additions and 191 deletions

View file

@ -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))
}