From 272355719fde430380f760f3c0d2e57b1929afec Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 18 Oct 2018 09:41:37 -0400 Subject: [PATCH] 14345: Accept lock/unlock requests as no-ops. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- services/keep-web/cadaver_test.go | 15 +++++++++++++++ services/keep-web/handler.go | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/services/keep-web/cadaver_test.go b/services/keep-web/cadaver_test.go index 0e2f17c35b..b89890956c 100644 --- a/services/keep-web/cadaver_test.go +++ b/services/keep-web/cadaver_test.go @@ -145,6 +145,16 @@ func (s *IntegrationSuite) testCadaver(c *check.C, password string, pathFunc fun cmd: "move testfile newdir0/\n", match: `(?ms).*Moving .* failed.*`, }, + { + path: writePath, + cmd: "lock newdir0/testfile\n", + match: `(?ms).*Locking .* succeeded.*`, + }, + { + path: writePath, + cmd: "unlock newdir0/testfile\nasdf\n", + match: `(?ms).*Unlocking .* succeeded.*`, + }, { path: writePath, cmd: "ls\n", @@ -243,6 +253,11 @@ func (s *IntegrationSuite) testCadaver(c *check.C, password string, pathFunc fun cmd: "delete foo\n", match: `(?ms).*Deleting .* failed:.*405 Method Not Allowed.*`, }, + { + path: pdhPath, + cmd: "lock foo\n", + match: `(?ms).*Locking .* failed:.*405 Method Not Allowed.*`, + }, } { c.Logf("%s %+v", "http://"+s.testServer.Addr, trial) if skip != nil && skip(trial.path) { diff --git a/services/keep-web/handler.go b/services/keep-web/handler.go index 95948e3250..6aeb7b9c48 100644 --- a/services/keep-web/handler.go +++ b/services/keep-web/handler.go @@ -143,20 +143,24 @@ var ( writeMethod = map[string]bool{ "COPY": true, "DELETE": true, + "LOCK": true, "MKCOL": true, "MOVE": true, "PUT": true, "RMCOL": true, + "UNLOCK": true, } webdavMethod = map[string]bool{ "COPY": true, "DELETE": true, + "LOCK": true, "MKCOL": true, "MOVE": true, "OPTIONS": true, "PROPFIND": true, "PUT": true, "RMCOL": true, + "UNLOCK": true, } browserMethod = map[string]bool{ "GET": true, -- 2.30.2