13111: Serve "site filesystem" at keep-web root URL.
authorTom Clegg <tclegg@veritasgenetics.com>
Thu, 5 Apr 2018 21:54:40 +0000 (17:54 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Thu, 5 Apr 2018 21:54:40 +0000 (17:54 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

services/keep-web/cadaver_test.go
services/keep-web/handler.go
services/keep-web/server_test.go

index 0fc6e47ba312f27893bf3af73e83248accb3078e..22ddd84df09e1883fa0aa1d83d540211c0efc39d 100644 (file)
@@ -266,6 +266,11 @@ func (s *IntegrationSuite) testCadaver(c *check.C, password string, pathFunc fun
 }
 
 func (s *IntegrationSuite) TestCadaverUsersDir(c *check.C) {
+       for _, path := range []string{"/"} {
+               stdout := s.runCadaver(c, arvadostest.ActiveToken, path, "ls")
+               c.Check(stdout, check.Matches, `(?ms).*Coll:\s+by_id\s+0 .*`)
+               c.Check(stdout, check.Matches, `(?ms).*Coll:\s+users\s+0 .*`)
+       }
        for _, path := range []string{"/users", "/users/"} {
                stdout := s.runCadaver(c, arvadostest.ActiveToken, path, "ls")
                c.Check(stdout, check.Matches, `(?ms).*Coll:\s+active.*`)
index 00af0f4eab86d3614170ef1e9f3af087ac333483..446eeb4a0ef51ea383068221cea88f3c626e78f9 100644 (file)
@@ -250,7 +250,7 @@ func (h *handler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
        } else if r.URL.Path == "/status.json" {
                h.serveStatus(w, r)
                return
-       } else if len(pathParts) >= 1 && pathParts[0] == "users" {
+       } else if r.URL.Path == "/" || (len(pathParts) >= 1 && pathParts[0] == "users") {
                useSiteFS = true
        } else if len(pathParts) >= 1 && strings.HasPrefix(pathParts[0], "c=") {
                // /c=ID[/PATH...]
index 02f03d04afd2af68abe4e18f9d816696fbcffdf6..ee585ad5b212af1f12f2bad3f162f8c1c11f3a2f 100644 (file)
@@ -59,7 +59,6 @@ func (s *IntegrationSuite) TestNoToken(c *check.C) {
 func (s *IntegrationSuite) Test404(c *check.C) {
        for _, uri := range []string{
                // Routing errors (always 404 regardless of what's stored in Keep)
-               "/",
                "/foo",
                "/download",
                "/collections",