Added some more comments about the implementation as well.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>
func (h *collectionFederatedRequestHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
m := collectionByPDHRe.FindStringSubmatch(req.URL.Path)
- if len(m) == 2 {
+ if len(m) == 2 && len(h.handler.Cluster.RemoteClusters) > 0 {
bearer := req.Header.Get("Authorization")
if strings.HasPrefix(bearer, "Bearer v2/") &&
len(bearer) > 10 &&
resp := s.testRequest(req)
defer resp.Body.Close()
- c.Check(resp.StatusCode, check.Equals, http.StatusBadGateway)
+ c.Check(resp.StatusCode, check.Equals, http.StatusNotFound)
}
func (s *FederationSuite) TestSaltedTokenGetCollectionByPDH(c *check.C) {