From 888d2bb1d8d3800477dd82e92e8625ed7b019a35 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 6 May 2024 17:08:42 -0700 Subject: [PATCH] support ETag value to be '*' (#19682) This supports '*' as per behavior to comply with AWS S3 behavior for - 'If-Match: *' - 'If-None-Match: *' --- cmd/object-handlers-common.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/object-handlers-common.go b/cmd/object-handlers-common.go index 3feff7b68..3b0cffe0a 100644 --- a/cmd/object-handlers-common.go +++ b/cmd/object-handlers-common.go @@ -23,6 +23,7 @@ import ( "net/http" "regexp" "strconv" + "strings" "time" "github.com/minio/minio/internal/amztime" @@ -325,6 +326,9 @@ func canonicalizeETag(etag string) string { // isETagEqual return true if the canonical representations of two ETag strings // are equal, false otherwise func isETagEqual(left, right string) bool { + if strings.TrimSpace(right) == "*" { + return true + } return canonicalizeETag(left) == canonicalizeETag(right) }