github-actions[bot] commented on code in PR #64147:
URL: https://github.com/apache/doris/pull/64147#discussion_r3419511384


##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/LoadAction.java:
##########
@@ -504,14 +505,11 @@ private TNetworkAddress 
selectEndpointByRedirectPolicy(HttpServletRequest req, B
         }
 
         String reqHost = "";
-        String[] pair = reqHostStr.split(":");
-        if (pair.length == 1) {
-            reqHost = pair[0];
-        } else if (pair.length == 2) {
-            reqHost = pair[0];
-        } else {
+        try {

Review Comment:
   This fixes parsing, but the parsed IPv6 private host now reaches the 
`public-private` IP branch and is still classified with 
`InetAddress.isSiteLocalAddress()`. On Java 17, ULA addresses such as 
`[fd00::2]:8030` return `false` for `isSiteLocalAddress()`; only the deprecated 
`fec0::/10` range returns true. So with `redirect-policy: public-private`, 
`public_endpoint=[2001:db8::1]:8040`, and `private_endpoint=[fd00::1]:8040`, 
this code parses the request host successfully and then chooses the public 
endpoint. Please treat IPv6 ULA/link-local ranges as private here and add a 
`public-private` IPv6 test; the current IPv6 test only covers the explicit 
`private` policy.



-- 
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]

Reply via email to