mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Fix SSE-C checksums (#19896)
Compression will be disabled by default if SSE-C is specified. So we can still honor SSE-C.
This commit is contained in:
@@ -20,6 +20,7 @@ package cmd
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -276,7 +277,7 @@ func (er erasureObjects) GetObjectNInfo(ctx context.Context, bucket, object stri
|
||||
return gr.WithCleanupFuncs(nsUnlocker), nil
|
||||
}
|
||||
|
||||
fn, off, length, err := NewGetObjectReader(rs, objInfo, opts)
|
||||
fn, off, length, err := NewGetObjectReader(rs, objInfo, opts, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1355,6 +1356,12 @@ func (er erasureObjects) putObject(ctx context.Context, bucket string, object st
|
||||
if opts.EncryptFn != nil {
|
||||
fi.Checksum = opts.EncryptFn("object-checksum", fi.Checksum)
|
||||
}
|
||||
if userDefined[ReplicationSsecChecksumHeader] != "" {
|
||||
if v, err := base64.StdEncoding.DecodeString(userDefined[ReplicationSsecChecksumHeader]); err == nil {
|
||||
fi.Checksum = v
|
||||
}
|
||||
}
|
||||
delete(userDefined, ReplicationSsecChecksumHeader)
|
||||
uniqueID := mustGetUUID()
|
||||
tempObj := uniqueID
|
||||
|
||||
|
||||
Reference in New Issue
Block a user