Schei! Encoding #20

Merged
june merged 3 commits from :Bendodroid-schei!Encoding into main 2024-01-16 01:56:35 +01:00
Showing only changes of commit fa6e6bd142 - Show all commits

View file

@ -19,7 +19,7 @@ func updateEndpointValidator(
// Check BasicAuth credentials
username, password, ok := r.BasicAuth()
if !ok || !util.CheckCredentials(authDB, validCredentials, username, password) {
w.Header().Set("WWW-Authenticate", "Basic realm=\"space-api\"")
w.Header()["WWW-Authenticate"] = []string{"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))
}