refs #19428
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>
import (
"encoding/json"
+ "errors"
"fmt"
"html"
"html/template"
http.Error(w, "session cache: "+err.Error(), http.StatusInternalServerError)
}
tokenUser, err = h.Cache.GetTokenUser(arv.ApiToken)
- if err != nil {
+ if e := (interface{ HTTPStatus() int })(nil); errors.As(err, &e) && e.HTTPStatus() == http.StatusForbidden {
+ // Ignore expected error looking up user record when
+ // using a scoped token that allows getting
+ // collections/X but not users/current
+ } else if err != nil {
http.Error(w, "user lookup: "+err.Error(), http.StatusInternalServerError)
}