From 394d9db212835cb10852a2046f81768e905e2b00 Mon Sep 17 00:00:00 2001 From: cbornet Date: Fri, 25 Sep 2026 17:44:52 +0200 Subject: [PATCH] Align some checksum error messages with S3 Signed-off-by: cbornet --- cmd/api-errors.go | 2 +- cmd/erasure-multipart-fullobject_test.go | 4 ++-- cmd/object-api-errors.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/api-errors.go b/cmd/api-errors.go index f2c82a78e6847..c60756d2393ca 100644 --- a/cmd/api-errors.go +++ b/cmd/api-errors.go @@ -550,7 +550,7 @@ var errorCodes = errorCodeMap{ }, ErrBadDigest: { Code: "BadDigest", - Description: "The Content-Md5 you specified did not match what we received.", + Description: "The Content-MD5 you specified did not match what we received.", HTTPStatusCode: http.StatusBadRequest, }, ErrEntityTooSmall: { diff --git a/cmd/erasure-multipart-fullobject_test.go b/cmd/erasure-multipart-fullobject_test.go index bb196acda3c16..b2707192a20a0 100644 --- a/cmd/erasure-multipart-fullobject_test.go +++ b/cmd/erasure-multipart-fullobject_test.go @@ -253,7 +253,7 @@ func testAPICompleteMultipartFullObjectChecksumMismatch(obj ObjectLayer, instanc if apiErr.Code != "BadDigest" { t.Fatalf("%s: expected BadDigest, got %q", instanceType, apiErr.Code) } - if want := "The CRC32 checksum you specified did not match the calculated checksum."; apiErr.Message != want { + if want := "The CRC32 you specified did not match the calculated checksum."; apiErr.Message != want { t.Fatalf("%s: expected message %q, got %q", instanceType, want, apiErr.Message) } @@ -361,7 +361,7 @@ func testAPICompleteMultipartCompositeChecksumMismatch(obj ObjectLayer, instance if apiErr.Code != "BadDigest" { t.Fatalf("%s: expected BadDigest, got %q", instanceType, apiErr.Code) } - if want := "The CRC32 checksum you specified did not match the calculated checksum."; apiErr.Message != want { + if want := "The CRC32 you specified did not match the calculated checksum."; apiErr.Message != want { t.Fatalf("%s: expected message %q, got %q", instanceType, want, apiErr.Message) } if _, err := obj.GetObjectInfo(t.Context(), bucketName, objectName, ObjectOptions{}); err == nil { diff --git a/cmd/object-api-errors.go b/cmd/object-api-errors.go index b4915b258e9ef..7b2b5e40459b6 100644 --- a/cmd/object-api-errors.go +++ b/cmd/object-api-errors.go @@ -668,7 +668,7 @@ var ( func completeMultipartChecksumMismatch(algorithm string) error { description := "The checksum you specified did not match the calculated checksum." if algorithm != "" { - description = fmt.Sprintf("The %s checksum you specified did not match the calculated checksum.", algorithm) + description = fmt.Sprintf("The %s you specified did not match the calculated checksum.", algorithm) } return fmt.Errorf("%w: %s", errCompleteMultipartChecksumMismatch, description) }