1
0
mirror of https://github.com/rancher/steve.git synced 2025-04-28 03:10:32 +00:00

Return 401 on auth failure

This commit is contained in:
Darren Shepherd 2020-03-21 07:49:44 -07:00
parent c61e788d6e
commit 72eb648550

View File

@ -130,7 +130,7 @@ func ToMiddleware(auth Authenticator) Middleware {
return func(rw http.ResponseWriter, req *http.Request, next http.Handler) {
info, ok, err := auth.Authenticate(req)
if err != nil {
rw.WriteHeader(http.StatusServiceUnavailable)
rw.WriteHeader(http.StatusUnauthorized)
rw.Write([]byte(err.Error()))
return
}