mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 16:34:30 +01:00
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
@ -1512,6 +1512,9 @@ func (f *Fs) newObjectWithExportInfo(
|
|||||||
// NewObject finds the Object at remote. If it can't be found
|
// NewObject finds the Object at remote. If it can't be found
|
||||||
// it returns the error fs.ErrorObjectNotFound.
|
// it returns the error fs.ErrorObjectNotFound.
|
||||||
func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) {
|
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)
|
info, extension, exportName, exportMimeType, isDocument, err := f.getRemoteInfoWithExport(ctx, remote)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user