Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Implemented PROPFIND with depth 0 (cs3org#3347)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 authored and vascoguita committed Oct 18, 2022
1 parent a2843b7 commit dde4133
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/unreleased/propfind-zero-depth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: Implemented PROPFIND with 0 depth

https://github.com/cs3org/reva/pull/3347
4 changes: 4 additions & 0 deletions internal/http/services/owncloud/ocdav/propfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dde4133

Please sign in to comment.