Ayasaz opened a new pull request, #16310:
URL: https://github.com/apache/dubbo/pull/16310

   ## What is the purpose of the change
   
   Fix `NetUtils.matchIpExpression(String pattern, String address)` to 
correctly parse IPv4 addresses with port (e.g. `192.168.1.63:90`).
   
   Previously the method used `address.endsWith(":")` to detect the `ip:port` 
format, which would never match a valid IPv4 address with port since the colon 
is in the middle, not at the end.
   
   ## Brief changelog
   
   - Changed the host/port parsing logic to use the existing `isValidAddress()` 
method (which matches `ADDRESS_PATTERN` regex 
`^\d{1,3}(\.\d{1,3}){3}\:\d{1,5}$`) to detect IPv4 addresses with port
   - Added test case `testMatchIpExpressionWithIpv4AddressAndPort` covering 
wildcard, subnet, and port-mismatch scenarios
   
   ## Verifying this change
   
   - Added unit test that covers:
     - Wildcard pattern with port: `*.*.*.*:90` matching `192.168.1.63:90`
     - Subnet pattern with port: `192.168.1.*:90` matching `192.168.1.63:90`
     - Port mismatch: `192.168.1.*:80` not matching `192.168.1.63:90`
   
   Fixes #16308


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