Skip to content

Commit 1be8b58

Browse files
committed
Support IPv6
1 parent ae1c514 commit 1be8b58

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

operator/src/main/java/oracle/kubernetes/operator/wlsconfig/PortDetails.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2021, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.kubernetes.operator.wlsconfig;
@@ -13,7 +13,15 @@ public PortDetails(int portNum, boolean portSecure) {
1313
this.portSecure = portSecure;
1414
}
1515

16+
/**
17+
* Generates a URL containing the host name.
18+
* @param host Host name
19+
* @return URL containing the indicated host name
20+
*/
1621
public String toHttpUrl(String host) {
22+
if (host.contains(":")) {
23+
host = "[" + host + "]";
24+
}
1725
return String.format("http%s://%s:%d", (portSecure ? "s" : ""), host, portNum);
1826
}
1927
}

0 commit comments

Comments
 (0)