mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 18:04:55 +01:00
crypt: return wrapped object even with no-data-encryption
In presence of no_data_encryption the Crypt's Put method used to over-optimize and returned base object. This patch makes it return Crypt-wrapped object now. Fixes #5498
This commit is contained in:
parent
85074f8f88
commit
7190c058a7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user