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:
parent
c61e788d6e
commit
72eb648550
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user