rafaelweingartner commented on a change in pull request #2734: Fix invalid 
consoleproxy url after upgrade
URL: https://github.com/apache/cloudstack/pull/2734#discussion_r200783410
 
 

 ##########
 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();
 
 Review comment:
   Would you mind extracting this block that creates the "proxyAddress" to a 
method? Then, we could have unit tests and documentation for it.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to