X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/35bc168c5a98dbe3b97c4b3179b4834b78a5b72c..8fc29fafb91cf64ce4ededbdd85ef9507c51f216:/services/keep-web/handler.go diff --git a/services/keep-web/handler.go b/services/keep-web/handler.go index 912398fa64..b5c11e553c 100644 --- a/services/keep-web/handler.go +++ b/services/keep-web/handler.go @@ -25,7 +25,7 @@ import ( "git.curoverse.com/arvados.git/sdk/go/health" "git.curoverse.com/arvados.git/sdk/go/httpserver" "git.curoverse.com/arvados.git/sdk/go/keepclient" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "golang.org/x/net/webdav" ) @@ -141,22 +141,28 @@ var ( "Depth", "Destination", "If", "Lock-Token", "Overwrite", "Timeout", }, ", ") writeMethod = map[string]bool{ - "COPY": true, - "DELETE": true, - "MKCOL": true, - "MOVE": true, - "PUT": true, - "RMCOL": true, + "COPY": true, + "DELETE": true, + "LOCK": true, + "MKCOL": true, + "MOVE": true, + "PROPPATCH": true, + "PUT": true, + "RMCOL": true, + "UNLOCK": true, } webdavMethod = map[string]bool{ - "COPY": true, - "DELETE": true, - "MKCOL": true, - "MOVE": true, - "OPTIONS": true, - "PROPFIND": true, - "PUT": true, - "RMCOL": true, + "COPY": true, + "DELETE": true, + "LOCK": true, + "MKCOL": true, + "MOVE": true, + "OPTIONS": true, + "PROPFIND": true, + "PROPPATCH": true, + "PUT": true, + "RMCOL": true, + "UNLOCK": true, } browserMethod = map[string]bool{ "GET": true, @@ -212,7 +218,7 @@ func (h *handler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) { return } w.Header().Set("Access-Control-Allow-Headers", corsAllowHeadersHeader) - w.Header().Set("Access-Control-Allow-Methods", "COPY, DELETE, GET, MKCOL, MOVE, OPTIONS, POST, PROPFIND, PUT, RMCOL") + w.Header().Set("Access-Control-Allow-Methods", "COPY, DELETE, GET, LOCK, MKCOL, MOVE, OPTIONS, POST, PROPFIND, PROPPATCH, PUT, RMCOL, UNLOCK") w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Max-Age", "86400") statusCode = http.StatusOK @@ -320,7 +326,7 @@ func (h *handler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) { if useSiteFS { if tokens == nil { - tokens = auth.NewCredentialsFromHTTPRequest(r).Tokens + tokens = auth.CredentialsFromRequest(r).Tokens } h.serveSiteFS(w, r, tokens, credentialsOK, attachment) return @@ -342,7 +348,7 @@ func (h *handler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) { if tokens == nil { if credentialsOK { - reqTokens = auth.NewCredentialsFromHTTPRequest(r).Tokens + reqTokens = auth.CredentialsFromRequest(r).Tokens } tokens = append(reqTokens, h.Config.AnonymousTokens...) }