mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-02-28 15:46:01 +01:00
Send Content-MD5 header on S3 uploads (#728)
Set SendContentMd5: true in PutObjectOptions so that minio-go includes a Content-MD5 header with every PutObject request. AWS S3 requires this header when the target bucket has Object Lock enabled; without it the upload is rejected with HTTP 400 (InvalidRequest). The overhead is negligible — one MD5 hash per upload — and the header also serves as a server-side integrity check for all uploads regardless of Object Lock. Fixes #727
This commit is contained in:
@@ -105,8 +105,9 @@ func (v *s3Storage) Name() string {
|
||||
func (b *s3Storage) Copy(file string) error {
|
||||
_, name := path.Split(file)
|
||||
putObjectOptions := minio.PutObjectOptions{
|
||||
ContentType: "application/tar+gzip",
|
||||
StorageClass: b.storageClass,
|
||||
ContentType: "application/tar+gzip",
|
||||
StorageClass: b.storageClass,
|
||||
SendContentMd5: true,
|
||||
}
|
||||
|
||||
if b.partSize > 0 {
|
||||
|
||||
Reference in New Issue
Block a user