rjgoyln commented on code in PR #11130:
URL: https://github.com/apache/ozone/pull/11130#discussion_r3885752779
##########
hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/http/TestBaseHttpServer.java:
##########
@@ -137,6 +138,23 @@ protected String getHttpAuthConfigPrefix() {
assertEquals("/1.2.3.4:1234", baseHttpServer
.getBindAddress("bindhostkey", "addresskey",
"default", 65).toString());
+
+ // An IPv6 bind host, wildcard or literal, must survive being combined with
+ // the port. Assert on the address rather than toString(), whose bracketing
+ // of IPv6 literals is a JDK detail.
+ conf.set("bindhostkey", "::");
+
+ InetSocketAddress wildcard = baseHttpServer
+ .getBindAddress("bindhostkey", "addresskey", "default", 65);
+ assertEquals(InetAddress.getByName("::"), wildcard.getAddress());
Review Comment:
Great catch on the silent `null` host. I extracted a package-private
`newEndpointUri` method to act as a test seam and added explicit test coverage
for it. Verified that reverting the fix now correctly turns the suite red
(`expected: <[...]> but was: <null>`).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]