Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

s3: don't check to see if remote is object if it ends with /

Nick Craig-Woodc0cda087a836
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)