From dde41335d287e2c418d3c94f9273098eb3451ba7 Mon Sep 17 00:00:00 2001 From: Gianmaria Del Monte <39946305+gmgigi96@users.noreply.github.com> Date: Thu, 13 Oct 2022 16:36:46 +0200 Subject: [PATCH] Implemented PROPFIND with depth 0 (#3347) --- changelog/unreleased/propfind-zero-depth.md | 3 +++ internal/http/services/owncloud/ocdav/propfind.go | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 changelog/unreleased/propfind-zero-depth.md 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