From bca896481509651847e99de0f47ad9fa6472acb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 14 Dec 2023 10:14:20 +0100 Subject: [PATCH] oc:spaceid should be in the form of {providerid}${spaceid} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/fix-ocdav-spaceid.md | 5 +++++ internal/http/services/owncloud/ocdav/propfind/propfind.go | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/fix-ocdav-spaceid.md diff --git a/changelog/unreleased/fix-ocdav-spaceid.md b/changelog/unreleased/fix-ocdav-spaceid.md new file mode 100644 index 0000000000..105286a6ae --- /dev/null +++ b/changelog/unreleased/fix-ocdav-spaceid.md @@ -0,0 +1,5 @@ +Bugfix: make ocdav return correct oc:spaceid + +propfinds now return `oc:spaceid` in the form of `{providerid}${spaceid}` + +https://github.com/cs3org/reva/pull/4407 diff --git a/internal/http/services/owncloud/ocdav/propfind/propfind.go b/internal/http/services/owncloud/ocdav/propfind/propfind.go index b2d098fffc..f9271fbbe9 100644 --- a/internal/http/services/owncloud/ocdav/propfind/propfind.go +++ b/internal/http/services/owncloud/ocdav/propfind/propfind.go @@ -1156,7 +1156,7 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p appendToOK( prop.Escaped("oc:id", sid), prop.Escaped("oc:fileid", sid), - prop.Escaped("oc:spaceid", id.SpaceId), + prop.Escaped("oc:spaceid", storagespace.FormatStorageID(id.StorageId, id.SpaceId)), ) } @@ -1296,7 +1296,7 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p } case "spaceid": if id != nil { - appendToOK(prop.Escaped("oc:spaceid", id.SpaceId)) + appendToOK(prop.Escaped("oc:spaceid", storagespace.FormatStorageID(id.StorageId, id.SpaceId))) } else { appendToNotFound(prop.Escaped("oc:spaceid", "")) }