fix: server upgrades should have more descriptive error messages (#11476)

during rolling upgrade, provide a more descriptive error
message and discourage rolling upgrade in such situations,
allowing users to take action.

additionally also rename `slashpath -> pathutil` to avoid
a slighly mis-pronounced usage of `path` package.
This commit is contained in:
Harshavardhana
2021-02-08 10:15:12 -08:00
committed by GitHub
parent 2e4d9124ad
commit 0e3211f4ad
4 changed files with 78 additions and 52 deletions

View File

@@ -498,6 +498,7 @@ func setAuthHandler(h http.Handler) http.Handler {
// Validate Authorization header if its valid for JWT request.
if _, _, authErr := webRequestAuthenticate(r); authErr != nil {
w.WriteHeader(http.StatusUnauthorized)
w.Write([]byte(authErr.Error()))
return
}
h.ServeHTTP(w, r)