projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
17202: Use explicit SameSite=Lax for 303-with-cookie.
[arvados.git]
/
services
/
keep-web
/
handler_test.go
diff --git
a/services/keep-web/handler_test.go
b/services/keep-web/handler_test.go
index f6f3de8877fa14abca9fc479216f13d4cb85a308..8e2e05c76184823d0a550bce92b93473879ec254 100644
(file)
--- a/
services/keep-web/handler_test.go
+++ b/
services/keep-web/handler_test.go
@@
-122,7
+122,7
@@
func (s *IntegrationSuite) TestVhost404(c *check.C) {
}
s.testServer.Handler.ServeHTTP(resp, req)
c.Check(resp.Code, check.Equals, http.StatusNotFound)
}
s.testServer.Handler.ServeHTTP(resp, req)
c.Check(resp.Code, check.Equals, http.StatusNotFound)
- c.Check(resp.Body.String(), check.Equals,
"
")
+ c.Check(resp.Body.String(), check.Equals,
notFoundMessage+"\n
")
}
}
}
}
@@
-250,7
+250,11
@@
func (s *IntegrationSuite) doVhostRequestsWithHostPath(c *check.C, authz authori
// depending on the authz method.
c.Check(code, check.Equals, failCode)
}
// depending on the authz method.
c.Check(code, check.Equals, failCode)
}
- c.Check(body, check.Equals, "")
+ if code == 404 {
+ c.Check(body, check.Equals, notFoundMessage+"\n")
+ } else {
+ c.Check(body, check.Equals, unauthorizedMessage+"\n")
+ }
}
}
}
}
}
}
@@
-307,7
+311,7
@@
func (s *IntegrationSuite) TestSingleOriginSecretLinkBadToken(c *check.C) {
"",
"",
http.StatusNotFound,
"",
"",
http.StatusNotFound,
-
"
",
+
notFoundMessage+"\n
",
)
}
)
}
@@
-321,7
+325,7
@@
func (s *IntegrationSuite) TestVhostRedirectQueryTokenToBogusCookie(c *check.C)
"",
"",
http.StatusUnauthorized,
"",
"",
http.StatusUnauthorized,
-
"
",
+
unauthorizedMessage+"\n
",
)
}
)
}
@@
-439,7
+443,7
@@
func (s *IntegrationSuite) TestVhostRedirectPOSTFormTokenToCookie404(c *check.C)
"application/x-www-form-urlencoded",
url.Values{"api_token": {arvadostest.SpectatorToken}}.Encode(),
http.StatusNotFound,
"application/x-www-form-urlencoded",
url.Values{"api_token": {arvadostest.SpectatorToken}}.Encode(),
http.StatusNotFound,
-
"
",
+
notFoundMessage+"\n
",
)
}
)
}
@@
-463,7
+467,7
@@
func (s *IntegrationSuite) TestAnonymousTokenError(c *check.C) {
"",
"",
http.StatusNotFound,
"",
"",
http.StatusNotFound,
-
"
",
+
notFoundMessage+"\n
",
)
}
)
}