diff --git a/changelog/unreleased/propfind-zero-depth.md b/changelog/unreleased/propfind-zero-depth.md new file mode 100644 index 00000000000..4435217e9e7 --- /dev/null +++ b/changelog/unreleased/propfind-zero-depth.md @@ -0,0 +1,3 @@ +Enhancement: Implemented PROPFIND with 0 depth + +https://github.com/cs3org/reva/pull/3347 \ No newline at end of file diff --git a/internal/http/services/owncloud/ocdav/propfind.go b/internal/http/services/owncloud/ocdav/propfind.go index abe69aca6e5..e5a94c6521d 100644 --- a/internal/http/services/owncloud/ocdav/propfind.go +++ b/internal/http/services/owncloud/ocdav/propfind.go @@ -286,6 +286,10 @@ func (s *svc) getResourceInfos(ctx context.Context, w http.ResponseWriter, r *ht resourceInfos := []*provider.ResourceInfo{parentInfo} switch { + case depth == "0": + // https://www.ietf.org/rfc/rfc2518.txt: + // the method is to be applied only to the resource + return parentInfo, resourceInfos, true case !spacesPropfind && parentInfo.Type != provider.ResourceType_RESOURCE_TYPE_CONTAINER: // The propfind is requested for a file that exists // In this case, we can stat the parent directory and return both