diff --git a/changelog/unreleased/add-name-to-propfindresponse.md b/changelog/unreleased/add-name-to-propfindresponse.md new file mode 100644 index 0000000000..41505d42d1 --- /dev/null +++ b/changelog/unreleased/add-name-to-propfindresponse.md @@ -0,0 +1,6 @@ +Bugfix: Add name to the propfind response + +Previously the file- or foldername had to be extracted from the href. This is not nice and +doesn't work for alias links. + +https://github.com/cs3org/reva/pull/3158 diff --git a/internal/http/services/owncloud/ocdav/propfind/propfind.go b/internal/http/services/owncloud/ocdav/propfind/propfind.go index 6afd9fc4c2..67edd1c0ab 100644 --- a/internal/http/services/owncloud/ocdav/propfind/propfind.go +++ b/internal/http/services/owncloud/ocdav/propfind/propfind.go @@ -987,6 +987,10 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p ) } + if md.Name != "" { + propstatOK.Prop = append(propstatOK.Prop, prop.Raw("oc:name", md.Name)) + } + if md.Etag != "" { // etags must be enclosed in double quotes and cannot contain them. // See https://tools.ietf.org/html/rfc7232#section-2.3 for details @@ -1311,6 +1315,8 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p propstatNotFound.Prop = append(propstatNotFound.Prop, prop.NotFound("oc:signature-auth")) } } + case "name": + propstatOK.Prop = append(propstatOK.Prop, prop.Raw("oc:name", md.Name)) case "privatelink": // phoenix only // https://phoenix.owncloud.com/f/9 fallthrough diff --git a/pkg/storage/utils/decomposedfs/node/node.go b/pkg/storage/utils/decomposedfs/node/node.go index 5a51ce6e53..1e8cd441c3 100644 --- a/pkg/storage/utils/decomposedfs/node/node.go +++ b/pkg/storage/utils/decomposedfs/node/node.go @@ -643,6 +643,7 @@ func (n *Node) AsResourceInfo(ctx context.Context, rp *provider.ResourcePermissi PermissionSet: rp, Owner: n.Owner(), ParentId: parentID, + Name: n.Name, } if nodeType == provider.ResourceType_RESOURCE_TYPE_CONTAINER {