fix: makes checksum type and algorithm case insensitive in CreateMultipartUpload

Fixes #1339

`x-amz-checksum-type` and `x-amz-checksum-algorithm` request headers should be case insensitive in `CreateMultipartUpload`.

The changes include parsing the header values to upper case before validating and passing to back-end. `x-amz-checksum-type` response header was added in`CreateMultipartUpload`, which was missing before.
This commit is contained in:
niksis02
2025-07-25 20:35:26 +04:00
parent 35fc8c214a
commit 3363988206
6 changed files with 54 additions and 21 deletions
+16
View File
@@ -39,6 +39,7 @@ import (
"sort"
"strings"
"time"
"unicode"
"github.com/aws/aws-sdk-go-v2/aws"
v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
@@ -1436,3 +1437,18 @@ type PublicBucketTestCase struct {
Call func(ctx context.Context) error
ExpectedErr error
}
// randomizeCase randomizes the provided string latters case
func randomizeCase(s string) string {
var b strings.Builder
for _, ch := range s {
if rnd.Intn(2) == 0 {
b.WriteRune(unicode.ToLower(ch))
} else {
b.WriteRune(unicode.ToUpper(ch))
}
}
return b.String()
}