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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]