You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "flyrain (via GitHub)" <gi...@apache.org> on 2025/03/01 00:03:34 UTC

Re: [PR] Treat headers as case-insensitive during RealmContext resolution [polaris]

flyrain commented on code in PR #1089:
URL: https://github.com/apache/polaris/pull/1089#discussion_r1976134567


##########
service/common/src/test/java/org/apache/polaris/service/context/DefaultRealmIdResolverTest.java:
##########
@@ -82,4 +82,17 @@ void headerNotPresentFailure() {
         .isInstanceOf(UnresolvableRealmContextException.class)
         .hasMessage("Missing required realm header: Polaris-Header");
   }
+
+  @Test
+  void headerCaseInsensitive() {
+    DefaultRealmContextResolver resolver = new DefaultRealmContextResolver(config);
+    RealmContext RealmContext1 =
+        resolver.resolveRealmContext(
+            "requestURL", "method", "path", Map.of("POLARIS-HEADER", "realm1"));
+    assertThat(RealmContext1.getRealmIdentifier()).isEqualTo("realm1");
+    RealmContext RealmContext2 =
+        resolver.resolveRealmContext(
+            "requestURL", "method", "path", Map.of("polaris-header", "realm2"));

Review Comment:
   Nit: add a test against map values as well?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org