"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: allow IsCollection property to be integer or boolean - fixes #2964
Nick Craig-Wood1c1a8ef24bea
diff --git a/backend/webdav/api/types.go b/backend/webdav/api/types.goindex eab79dccf..8fe89279d 100644--- a/backend/webdav/api/types.go+++ b/backend/webdav/api/types.go@@ -69,7 +69,7 @@ type Prop struct {Status []string `xml:"DAV: status"`Name string `xml:"DAV: prop>displayname,omitempty"`Type *xml.Name `xml:"DAV: prop>resourcetype>collection,omitempty"`- IsCollection *int `xml:"DAV: prop>iscollection,omitempty"` // this is a Microsoft extension see #2716+ IsCollection *string `xml:"DAV: prop>iscollection,omitempty"` // this is a Microsoft extension see #2716Size int64 `xml:"DAV: prop>getcontentlength,omitempty"`Modified Time `xml:"DAV: prop>getlastmodified,omitempty"`Checksums []string `xml:"prop>checksums>checksum,omitempty"`diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.goindex 54e11f505..889da8cdf 100644--- a/backend/webdav/webdav.go+++ b/backend/webdav/webdav.go@@ -173,9 +173,16 @@ func itemIsDir(item *api.Response) bool {fs.Debugf(nil, "Unknown resource type %q/%q on %q", t.Space, t.Local, item.Props.Name)}// the iscollection prop is a Microsoft extension, but if present it is a reliable indicator- // if the above check failed - see #2716+ // if the above check failed - see #2716. This can be an integer or a boolean - see #2964if t := item.Props.IsCollection; t != nil {- return *t != 0+ switch x := strings.ToLower(*t); x {+ case "0", "false":+ return false+ case "1", "true":+ return true+ default:+ fs.Debugf(nil, "Unknown value %q for IsCollection", x)+ }}return false}