DaanHoogland commented on code in PR #13058:
URL: https://github.com/apache/cloudstack/pull/13058#discussion_r3773076621


##########
services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxy.java:
##########
@@ -502,40 +603,49 @@ public static ConsoleProxyClient 
getAjaxVncViewer(ConsoleProxyClientParam param,
                 viewer = getClient(param);
                 viewer.initClient(param);
 
+
                 connectionMap.put(clientKey, viewer);
                 LOGGER.info("Added viewer object " + viewer);
                 reportLoadChange = true;
             } else {
                 // protected against malicious attack by modifying URL content
                 if (ajaxSession != null) {
                     long ajaxSessionIdFromUrl = Long.parseLong(ajaxSession);
-                    if (ajaxSessionIdFromUrl != viewer.getAjaxSessionId())
+                    if (ajaxSessionIdFromUrl != viewer.getAjaxSessionId()) {
                         throw new AuthenticationException("Cannot use the 
existing viewer " + viewer + ": modified AJAX session id");
+                    }
                 }
 
-                if (param.getClientHostPassword() == null || 
param.getClientHostPassword().isEmpty() ||
-                        
!param.getClientHostPassword().equals(viewer.getClientHostPassword()))
+
+                if (param.getClientHostPassword() == null || 
param.getClientHostPassword().isEmpty()
+                        || 
!param.getClientHostPassword().equals(viewer.getClientHostPassword())) {
                     throw new AuthenticationException("Cannot use the existing 
viewer " + viewer + ": bad sid");
+                }
+

Review Comment:
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to