mirror of
https://github.com/rancher/steve.git
synced 2025-08-01 23:03:28 +00:00
Return 401 on auth failure
This commit is contained in:
parent
c61e788d6e
commit
72eb648550
@ -130,7 +130,7 @@ func ToMiddleware(auth Authenticator) Middleware {
|
|||||||
return func(rw http.ResponseWriter, req *http.Request, next http.Handler) {
|
return func(rw http.ResponseWriter, req *http.Request, next http.Handler) {
|
||||||
info, ok, err := auth.Authenticate(req)
|
info, ok, err := auth.Authenticate(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rw.WriteHeader(http.StatusServiceUnavailable)
|
rw.WriteHeader(http.StatusUnauthorized)
|
||||||
rw.Write([]byte(err.Error()))
|
rw.Write([]byte(err.Error()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user