diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 9aea35c18..ccdeebf14 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -1693,7 +1693,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e GetTier: true, SlowModTime: true, }).Fill(ctx, f) - if f.rootBucket != "" && f.rootDirectory != "" && !opt.NoHeadObject { + if f.rootBucket != "" && f.rootDirectory != "" && !opt.NoHeadObject && !strings.HasSuffix(root, "/") { // Check to see if the (bucket,directory) is actually an existing file oldRoot := f.root newRoot, leaf := path.Split(oldRoot)