@@ -40,6 +40,8 @@ const (
40
40
// DefaultSecretsRefreshInterval is the default value for RefreshSecrets.
41
41
// It should not be too high so as to retrieve secrets regularly.
42
42
DefaultSecretsRefreshInterval = 15 * time .Second
43
+ // DefaultDisableContentMd5 : disable sending the Content-MD5 header
44
+ DefaultDisableContentMd5 = false
43
45
)
44
46
45
47
// Options describes the storage options for the S3 backend
@@ -82,6 +84,9 @@ type Options struct {
82
84
// or "https://s3.amazonaws.com" for AWS S3.
83
85
EndpointURL string `yaml:"endpoint_url"`
84
86
87
+ // DisableContentMd5 defines whether to disable sending the Content-MD5 header
88
+ DisableContentMd5 bool `yaml:"disable_send_content_md5"`
89
+
85
90
// TLS allows customising the TLS configuration
86
91
// See https://github.com/PowerDNS/go-tlsconfig for the available options
87
92
TLS tlsconfig.Config `yaml:"tls"`
@@ -262,9 +267,14 @@ func (b *Backend) doStore(ctx context.Context, name string, data []byte) (minio.
262
267
metricCalls .WithLabelValues ("store" ).Inc ()
263
268
metricLastCallTimestamp .WithLabelValues ("store" ).SetToCurrentTime ()
264
269
265
- info , err := b . client . PutObject ( ctx , b . opt . Bucket , name , bytes . NewReader ( data ), int64 ( len ( data )), minio.PutObjectOptions {
270
+ putObjectOptions := minio.PutObjectOptions {
266
271
NumThreads : 3 ,
267
- })
272
+ }
273
+ if ! b .opt .DisableContentMd5 {
274
+ putObjectOptions .SendContentMd5 = true
275
+ }
276
+
277
+ info , err := b .client .PutObject (ctx , b .opt .Bucket , name , bytes .NewReader (data ), int64 (len (data )), putObjectOptions )
268
278
if err != nil {
269
279
metricCallErrors .WithLabelValues ("store" ).Inc ()
270
280
}
0 commit comments