From 21849fd0d9c192475b4098917dafc7cb4ffda2d8 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 31 Jan 2023 12:07:21 +0000 Subject: [PATCH] webdav: fix interop with davrods server The davrods server returns URLS with a double / in and the // confuses rclone into thinking these files are in a directory called "". The fix removes leading /s from the directory listing names. See: https://forum.rclone.org/t/upload-to-webdav-does-not-check-if-files-already-exist/35756/ --- backend/webdav/webdav.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go index 251202948..371d5f71d 100644 --- a/backend/webdav/webdav.go +++ b/backend/webdav/webdav.go @@ -712,6 +712,7 @@ func (f *Fs) listAll(ctx context.Context, dir string, directoriesOnly bool, file continue } subPath := u.Path[len(baseURL.Path):] + subPath = strings.TrimPrefix(subPath, "/") // ignore leading / here for davrods if f.opt.Enc != encoder.EncodeZero { subPath = f.opt.Enc.ToStandardPath(subPath) }