This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new ccf67f6d2b2 HDDS-14849. LowerCaseKeyStringMap.remove() should 
transform key toLowerCase (#9937)
ccf67f6d2b2 is described below

commit ccf67f6d2b2c68ffcef83f3e09134be74a9da03f
Author: Chun-Hung Tseng <[email protected]>
AuthorDate: Thu Mar 19 02:30:24 2026 +0900

    HDDS-14849. LowerCaseKeyStringMap.remove() should transform key toLowerCase 
(#9937)
---
 .../ozone/s3/signature/AWSSignatureProcessor.java  |  2 +-
 .../s3/signature/TestAWSSignatureProcessor.java    | 40 ++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git 
a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/signature/AWSSignatureProcessor.java
 
b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/signature/AWSSignatureProcessor.java
index 7d8f2fe04e9..02067537495 100644
--- 
a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/signature/AWSSignatureProcessor.java
+++ 
b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/signature/AWSSignatureProcessor.java
@@ -197,7 +197,7 @@ public String put(String key, String value) {
 
     @Override
     public String remove(Object key) {
-      return delegate.remove(key.toString());
+      return delegate.remove(key.toString().toLowerCase());
     }
 
     @Override
diff --git 
a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/signature/TestAWSSignatureProcessor.java
 
b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/signature/TestAWSSignatureProcessor.java
new file mode 100644
index 00000000000..199866f833c
--- /dev/null
+++ 
b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/signature/TestAWSSignatureProcessor.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.s3.signature;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests for {@link AWSSignatureProcessor}.
+ */
+public class TestAWSSignatureProcessor {
+
+  @Test
+  public void testLowerCaseHeaderMapRemovesKeysCaseInsensitively() {
+    AWSSignatureProcessor.LowerCaseKeyStringMap headers =
+        new AWSSignatureProcessor.LowerCaseKeyStringMap();
+    headers.put("Authorization", "AWS4-HMAC-SHA256 value");
+
+    assertEquals("AWS4-HMAC-SHA256 value",
+        headers.remove("AUTHORIZATION"));
+    assertFalse(headers.containsKey("authorization"));
+  }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to