This is an automated email from the ASF dual-hosted git repository.

robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git

commit a91c3000b2a2ea1de8d9f41aeaf30692088e2462
Author: Robert Lazarski <[email protected]>
AuthorDate: Mon Apr 20 10:59:41 2026 -1000

    AXIS2-5858 Bracket IPv6 addresses in soap:address location URLs
    
    When the detected IP address is IPv6 (contains ':'), wrap it in
    brackets per RFC 2732. Without this, a soap:address like
    http://fe80::1:8080/services/MyService is invalid — it should be
    http://[fe80::1]:8080/services/MyService.
    
    The IPv6-aware IP detection in Utils.getIpAddress() (which prefers
    IPv4 for backward compatibility) was contributed by Christian Ortlepp
    in PR #842. This commit adds the URL formatting fix that completes
    the IPv6 support.
    
    Co-Authored-By: Christian Ortlepp <[email protected]>
---
 .../java/org/apache/axis2/transport/http/HTTPTransportUtils.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/modules/transport/http/src/main/java/org/apache/axis2/transport/http/HTTPTransportUtils.java
 
b/modules/transport/http/src/main/java/org/apache/axis2/transport/http/HTTPTransportUtils.java
index 4800f1ca43..c60625c377 100644
--- 
a/modules/transport/http/src/main/java/org/apache/axis2/transport/http/HTTPTransportUtils.java
+++ 
b/modules/transport/http/src/main/java/org/apache/axis2/transport/http/HTTPTransportUtils.java
@@ -427,7 +427,14 @@ public class HTTPTransportUtils {
                 String scheme = trpInDesc.getName();
                 epr.append(scheme);
                 epr.append("://");
-                epr.append(ip);
+                // AXIS2-5858: IPv6 addresses must be enclosed in brackets in 
URLs (RFC 2732)
+                if (ip != null && ip.contains(":")) {
+                    epr.append('[');
+                    epr.append(ip);
+                    epr.append(']');
+                } else {
+                    epr.append(ip);
+                }
                 if (!(scheme.equals("http") && port == 80
                         || scheme.equals("https") && port == 443)) {
                     epr.append(':');

Reply via email to