--wip-- [skip ci]
This commit is contained in:
parent
ccf3981d8d
commit
7a8b904852
10 changed files with 282 additions and 191 deletions
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue