From a29a1de43dd69f936776d4bdd779559377ef42cb Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 18 Jun 2018 12:13:47 +0100 Subject: [PATCH] webdav: if root ends with / then don't check if it is a file --- backend/webdav/webdav.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go index 91b1320e7..ba4e75cab 100644 --- a/backend/webdav/webdav.go +++ b/backend/webdav/webdav.go @@ -258,6 +258,7 @@ func NewFs(name, root string) (fs.Fs, error) { if !strings.HasSuffix(endpoint, "/") { endpoint += "/" } + rootIsDir := strings.HasSuffix(root, "/") root = strings.Trim(root, "/") user := config.FileGet(name, "user") @@ -297,7 +298,7 @@ func NewFs(name, root string) (fs.Fs, error) { return nil, err } - if root != "" { + if root != "" && !rootIsDir { // Check to see if the root actually an existing file remote := path.Base(root) f.root = path.Dir(root)