diff --git a/internal/bucket/object/lock/lock.go b/internal/bucket/object/lock/lock.go index 6ba9857a2..572e9db66 100644 --- a/internal/bucket/object/lock/lock.go +++ b/internal/bucket/object/lock/lock.go @@ -572,6 +572,7 @@ func FilterObjectLockMetadata(metadata map[string]string, filterRetention, filte dst := metadata var copied bool delKey := func(key string) { + key = strings.ToLower(key) if _, ok := metadata[key]; !ok { return } diff --git a/internal/bucket/object/lock/lock_test.go b/internal/bucket/object/lock/lock_test.go index d800a5332..91313482d 100644 --- a/internal/bucket/object/lock/lock_test.go +++ b/internal/bucket/object/lock/lock_test.go @@ -606,7 +606,7 @@ func TestFilterObjectLockMetadata(t *testing.T) { for i, tt := range tests { o := FilterObjectLockMetadata(tt.metadata, tt.filterRetention, tt.filterLegalHold) - if !reflect.DeepEqual(o, tt.metadata) { + if !reflect.DeepEqual(o, tt.expected) { t.Fatalf("Case %d expected %v, got %v", i, tt.metadata, o) } }