Skip to content

Commit 4e00fdf

Browse files
sseagokaovilai
authored andcommitted
Merge pull request #308 from clementnuss/fix-amz-checksum-bug
Fix prevent amz-checksum encapsulation when checksumAlgorithm="" (cherry picked from commit 4de46bd)
1 parent dbc663c commit 4e00fdf

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix S3 failures on backends that reject the `x-amz-checksum` header by only calculating/validating checksums when explicitly required.

velero-plugin-for-aws/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ func newS3Client(cfg aws.Config, url string, forcePathStyle bool) (*s3.Client, e
9292
opts := []func(*s3.Options){
9393
func(o *s3.Options) {
9494
o.UsePathStyle = forcePathStyle
95+
// Only calculate/validate checksums when explicitly requested.
96+
// See https://github.com/velero-io/velero/issues/9951
97+
o.RequestChecksumCalculation = aws.RequestChecksumCalculationWhenRequired
98+
o.ResponseChecksumValidation = aws.ResponseChecksumValidationWhenRequired
9599
},
96100
}
97101
if url != "" {

0 commit comments

Comments
 (0)