local, yandex, dropbox: fix NewObject suceeding on a directory #1079

Add tests to make it consistent across all remotes
This commit is contained in:
Nick Craig-Wood
2017-02-25 11:09:57 +00:00
parent 527099ae72
commit 79e3c67bbd
20 changed files with 66 additions and 34 deletions
+3
View File
@@ -162,6 +162,9 @@ func (f *Fs) newObjectWithInfo(remote string, info os.FileInfo) (fs.Object, erro
return nil, err
}
}
if !o.info.Mode().IsRegular() {
return nil, errors.Wrapf(fs.ErrorNotAFile, "%q", remote)
}
return o, nil
}