Merge pull request #1365 from felix9/fix_1068

Fix failure to detect some legacy s3 repos
This commit is contained in:
Alexander Neumann 2017-10-21 12:19:58 +02:00
commit 90b96d19cd

View file

@ -172,8 +172,9 @@ func (be *Backend) ReadDir(dir string) (list []os.FileInfo, err error) {
}
name := strings.TrimPrefix(obj.Key, dir)
// Sometimes s3 returns an entry for the dir itself. Ignore it.
if name == "" {
return nil, errors.Errorf("invalid key name %v, removing prefix %v yielded empty string", obj.Key, dir)
continue
}
entry := fileInfo{
name: name,