drive: fix trailing slash mis-identificaton of folder as file
Before this change, drive would mistakenly identify a folder with a training slash as a file when passed to NewObject. This was picked up by the integration tests
This commit is contained in:
parent
44ac79e357
commit
232d304c13
1 changed files with 3 additions and 0 deletions
|
@ -1512,6 +1512,9 @@ func (f *Fs) newObjectWithExportInfo(
|
|||
// NewObject finds the Object at remote. If it can't be found
|
||||
// it returns the error fs.ErrorObjectNotFound.
|
||||
func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) {
|
||||
if strings.HasSuffix(remote, "/") {
|
||||
return nil, fs.ErrorIsDir
|
||||
}
|
||||
info, extension, exportName, exportMimeType, isDocument, err := f.getRemoteInfoWithExport(ctx, remote)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in a new issue