diff --git a/backend/box/box.go b/backend/box/box.go index 7a222b162..d47073703 100644 --- a/backend/box/box.go +++ b/backend/box/box.go @@ -323,7 +323,7 @@ func shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, err } authRetry := false - if resp != nil && resp.StatusCode == 401 && len(resp.Header["Www-Authenticate"]) == 1 && strings.Index(resp.Header["Www-Authenticate"][0], "expired_token") >= 0 { + if resp != nil && resp.StatusCode == 401 && strings.Contains(resp.Header.Get("Www-Authenticate"), "expired_token") { authRetry = true fs.Debugf(nil, "Should retry: %v", err) }