"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
webdav: ensure we call MKCOL with a URL with a trailing / #2350
Nick Craig-Woode7ae5e8ee033
diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.goindex a08d8975f..91b1320e7 100644--- a/backend/webdav/webdav.go+++ b/backend/webdav/webdav.go@@ -542,6 +542,11 @@ func (f *Fs) PutStream(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption// mkParentDir makes the parent of the native path dirPath if// necessary and any directories above thatfunc (f *Fs) mkParentDir(dirPath string) error {+ // defer log.Trace(dirPath, "")("")+ // chop off trailing / if it exists+ if strings.HasSuffix(dirPath, "/") {+ dirPath = dirPath[:len(dirPath)-1]+ }parent := path.Dir(dirPath)if parent == "." {parent = ""@@ -551,10 +556,15 @@ func (f *Fs) mkParentDir(dirPath string) error {// mkdir makes the directory and parents using native pathsfunc (f *Fs) mkdir(dirPath string) error {+ // defer log.Trace(dirPath, "")("")// We assume the root is already ceatedif dirPath == "" {return nil}+ // Collections must end with /+ if !strings.HasSuffix(dirPath, "/") {+ dirPath += "/"+ }opts := rest.Opts{Method: "MKCOL",Path: dirPath,