[#510] Fix listing with prefix

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
remotes/KirillovDenis/bugfix/681-fix_acl_parsing
Denis Kirillov 2022-06-07 18:34:43 +03:00 committed by Alex Vanin
parent 3f5afabd4a
commit cb5237fb82
1 changed files with 2 additions and 2 deletions

View File

@ -563,7 +563,7 @@ func (c *TreeClient) GetLatestVersionsByPrefix(ctx context.Context, cnrID *cid.I
func (c *TreeClient) determinePrefixNode(ctx context.Context, cnrID *cid.ID, treeID, prefix string) (uint64, string, error) {
var rootID uint64
path := strings.Split(prefix, separator)
if path[0] == "" {
if len(path) > 1 && path[0] == "" {
path[0] = emptyFileName
}
tailPrefix := path[len(path)-1]
@ -594,7 +594,7 @@ func (c *TreeClient) getPrefixNodeID(ctx context.Context, cnrID *cid.ID, treeID
var intermediateNodes []uint64
for _, node := range nodes {
if !isIntermediate(node) {
if isIntermediate(node) {
intermediateNodes = append(intermediateNodes, node.GetNodeId())
}
}