X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/83974ae9df4060f7aaa6bba61997404a2a7405b2..f5a90a8dd208596aa8ce8cfd3086bd367b84b147:/services/keep-web/cache.go diff --git a/services/keep-web/cache.go b/services/keep-web/cache.go index db06d63509..c73191103e 100644 --- a/services/keep-web/cache.go +++ b/services/keep-web/cache.go @@ -5,6 +5,7 @@ package keepweb import ( + "errors" "net/http" "sync" "sync/atomic" @@ -168,7 +169,7 @@ func (c *cache) GetSession(token string) (arvados.CustomFileSystem, *cachedSessi if user == nil || expired { user = new(arvados.User) err := sess.client.RequestAndDecode(user, "GET", "/arvados/v1/users/current", nil, nil) - if statusErr, ok := err.(interface{ HTTPStatus() int }); ok && statusErr.HTTPStatus() == http.StatusForbidden { + if he := errorWithHTTPStatus(nil); errors.As(err, &he) && he.HTTPStatus() == http.StatusForbidden { // token is OK, but "get user id" api is out // of scope -- return nil, signifying unknown // user