Skip to content

Commit

Permalink
adjust path when statting public link
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <jkoberg@owncloud.com>
  • Loading branch information
kobergj committed Dec 20, 2021
1 parent 758d893 commit a75182c
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,22 @@ func (s *service) translatePublicRefToCS3Ref(ctx context.Context, ref *provider.
return nil, "", nil, st, nil
}

var path string
switch shareInfo.Type {
case provider.ResourceType_RESOURCE_TYPE_CONTAINER:
// folders point to the folder -> path needs to be added
path = utils.MakeRelativePath(relativePath)
case provider.ResourceType_RESOURCE_TYPE_FILE:
// files already point to the correct id
path = "."
default:
// TODO: can this happen?
// path = utils.MakeRelativePath(relativePath)
}

cs3Ref := &provider.Reference{
ResourceId: shareInfo.Id,
Path: utils.MakeRelativePath(relativePath),
Path: path,
}

log.Debug().
Expand Down

0 comments on commit a75182c

Please sign in to comment.