diff --git a/api/client.go b/api/client.go index 4aee40c0a7252..c6c78ada9e29b 100644 --- a/api/client.go +++ b/api/client.go @@ -48,7 +48,7 @@ type Config struct { redirectSetup sync.Once // MaxRetries controls the maximum number of times to retry when a 5xx error - // occurs. Set to 0 or less to disable retrying. + // occurs. Set to 0 or less to disable retrying. Defaults to 0. MaxRetries int } @@ -99,8 +99,6 @@ func DefaultConfig() *Config { config.Address = v } - config.MaxRetries = pester.DefaultClient.MaxRetries - return config } diff --git a/http/sys_seal.go b/http/sys_seal.go index 2e02f7308ad16..53bab8b8e5c75 100644 --- a/http/sys_seal.go +++ b/http/sys_seal.go @@ -30,8 +30,13 @@ func handleSysSeal(core *vault.Core) http.Handler { // Seal with the token above if err := core.SealWithRequest(req); err != nil { - respondError(w, http.StatusInternalServerError, err) - return + if errwrap.Contains(err, logical.ErrPermissionDenied) { + respondError(w, http.StatusUnauthorized, err) + return + } else { + respondError(w, http.StatusInternalServerError, err) + return + } } respondOk(w, nil)