You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ro...@apache.org on 2026/04/20 21:30:52 UTC
(axis-axis2-java-core) 01/02: AXIS2-5858 Bracket IPv6 addresses in soap:address location URLs
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 <ro...@gmail.com>
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 <co...@users.noreply.github.com>
---
.../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(':');