rafaelweingartner commented on a change in pull request #2734: Fix invalid
consoleproxy url after upgrade
URL: https://github.com/apache/cloudstack/pull/2734#discussion_r200783318
##########
File path: core/src/main/java/com/cloud/info/ConsoleProxyInfo.java
##########
@@ -36,33 +36,33 @@ public ConsoleProxyInfo(int proxyUrlPort) {
public ConsoleProxyInfo(boolean sslEnabled, String proxyIpAddress, int
port, int proxyUrlPort, String consoleProxyUrlDomain) {
this.sslEnabled = sslEnabled;
- if (sslEnabled) {
- StringBuffer sb = new StringBuffer();
- if (consoleProxyUrlDomain.startsWith("*")) {
- sb.append(proxyIpAddress);
- for (int i = 0; i < proxyIpAddress.length(); i++)
- if (sb.charAt(i) == '.')
- sb.setCharAt(i, '-');
- sb.append(consoleProxyUrlDomain.substring(1));//skip the *
- } else {
- //LB address
- sb.append(consoleProxyUrlDomain);
- }
- proxyAddress = sb.toString();
- proxyPort = port;
- this.proxyUrlPort = proxyUrlPort;
+ StringBuffer sb = new StringBuffer();
+ // Domain in format *.example.com
+ if (consoleProxyUrlDomain.startsWith("*")) {
+ sb.append(proxyIpAddress);
+ for (int i = 0; i < proxyIpAddress.length(); i++)
Review comment:
You can replace this block with a "replaceAll" method, right?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services