X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ef25437d74cd7c2ce9ba4df2364c1da3d06b8bbb..4257184a0fd276af7e1741dda8a7468a30b4a9c6:/lib/controller/handler_test.go diff --git a/lib/controller/handler_test.go b/lib/controller/handler_test.go index 5dc0b1e86f..ebadc5d021 100644 --- a/lib/controller/handler_test.go +++ b/lib/controller/handler_test.go @@ -165,11 +165,18 @@ func (s *HandlerSuite) TestProxyNotFound(c *check.C) { } func (s *HandlerSuite) TestProxyRedirect(c *check.C) { + s.cluster.Login.ProviderAppID = "test" + s.cluster.Login.ProviderAppSecret = "test" req := httptest.NewRequest("GET", "https://0.0.0.0:1/login?return_to=foo", nil) resp := httptest.NewRecorder() s.handler.ServeHTTP(resp, req) - c.Check(resp.Code, check.Equals, http.StatusFound) - c.Check(resp.Header().Get("Location"), check.Matches, `https://0.0.0.0:1/auth/joshid\?return_to=%2Cfoo&?`) + if !c.Check(resp.Code, check.Equals, http.StatusFound) { + c.Log(resp.Body.String()) + } + // Old "proxy entire request" code path returns an absolute + // URL. New lib/controller/federation code path returns a + // relative URL. + c.Check(resp.Header().Get("Location"), check.Matches, `(https://0.0.0.0:1)?/auth/joshid\?return_to=%2Cfoo&?`) } func (s *HandlerSuite) TestValidateV1APIToken(c *check.C) {