mirror of https://github.com/status-im/consul.git
agent: use http.StatusUnauthorized instead of 401
This commit is contained in:
parent
5d1546b052
commit
7e2bc1b411
|
@ -16,7 +16,7 @@ type aclCreateResponse struct {
|
||||||
|
|
||||||
// ACLDisabled handles if ACL datacenter is not configured
|
// ACLDisabled handles if ACL datacenter is not configured
|
||||||
func ACLDisabled(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
|
func ACLDisabled(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
|
||||||
resp.WriteHeader(401)
|
resp.WriteHeader(http.StatusUnauthorized) // 401
|
||||||
fmt.Fprint(resp, "ACL support disabled")
|
fmt.Fprint(resp, "ACL support disabled")
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
// coordinateDisabled handles all the endpoints when coordinates are not enabled,
|
// coordinateDisabled handles all the endpoints when coordinates are not enabled,
|
||||||
// returning an error message.
|
// returning an error message.
|
||||||
func coordinateDisabled(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
|
func coordinateDisabled(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
|
||||||
resp.WriteHeader(401)
|
resp.WriteHeader(http.StatusUnauthorized) // 401
|
||||||
fmt.Fprint(resp, "Coordinate support disabled")
|
fmt.Fprint(resp, "Coordinate support disabled")
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue