Skip to content

Commit

Permalink
Fix errors, wrong prefix in filestorage, the suffix did not start wit…
Browse files Browse the repository at this point in the history
…h "/".
  • Loading branch information
visill committed Oct 18, 2024
1 parent b37f0f5 commit 5905cda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/storage/filestorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ func (s *FileStorageInteractor) ListPath(prefix string) ([]*object.ObjectInfo, e
if err != nil {
return err
}
cPath, ok := strings.CutPrefix(path, prefix)
cPath, ok := strings.CutPrefix(path, s.cnf.StoragePrefix)

if !ok {
return err
}
data = append(data, &object.ObjectInfo{Path: cPath, Size: fileinfo.Size()})
data = append(data, &object.ObjectInfo{Path: "/" + cPath, Size: fileinfo.Size()})
return nil
})
return data, err
Expand Down

0 comments on commit 5905cda

Please sign in to comment.