webdav: fix identification of directories for Bitrix Site Manager - #2716
Bitrix Site Manager emits `<D:resourcetype><collection/></D:resourcetype>` missing the namespace on the `collection` tag. This causes the item to be identified as a file instead of a directory. To work around this look at the Microsoft extension prop `iscollection` which seems to be emitted as well.
This commit is contained in:
@@ -172,6 +172,11 @@ 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 t := item.Props.IsCollection; t != nil {
|
||||
return *t != 0
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user