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

crypt: return wrapped object even with no-data-encryption

Ivan Andreev7190c058a76d
diff --git a/backend/crypt/crypt.go b/backend/crypt/crypt.go
index 14d7915cb..227a42587 100644
--- a/backend/crypt/crypt.go
+++ b/backend/crypt/crypt.go
@@ -363,7 +363,11 @@ type putFn func(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ..
// put implements Put or PutStream
func (f *Fs) put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options []fs.OpenOption, put putFn) (fs.Object, error) {
if f.opt.NoDataEncryption {
- return put(ctx, in, f.newObjectInfo(src, nonce{}), options...)
+ o, err := put(ctx, in, f.newObjectInfo(src, nonce{}), options...)
+ if err == nil && o != nil {
+ o = f.newObject(o)
+ }
+ return o, err
}
// Encrypt the data into wrappedIn