You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/12/10 16:10:54 UTC

[GitHub] GabrielBrascher commented on a change in pull request #3091: Address reviewers from abandoned PR #1597.

GabrielBrascher commented on a change in pull request #3091: Address reviewers from abandoned PR #1597.
URL: https://github.com/apache/cloudstack/pull/3091#discussion_r240274570
 
 

 ##########
 File path: services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyHttpHandlerHelper.java
 ##########
 @@ -23,20 +23,34 @@
 
 public class ConsoleProxyHttpHandlerHelper {
     private static final Logger s_logger = Logger.getLogger(ConsoleProxyHttpHandlerHelper.class);
+    private static final String AND = "&";
+    private static final String EQUALS = "=";
+    private static final String HOST = "host";
+    private static final String PORT = "port";
+    private static final String SID = "sid";
+    private static final String TAG = "tag";
+    private static final String CONSOLE_URL = "consoleurl";
+    private static final String SESSION_REF = "sessionref";
+    private static final String TICKET = "ticket";
+    private static final String LOCALE = "locale";
+    private static final String HYPERV_HOST = "hypervHost";
+    private static final String USERNAME = "username";
+    private static final String PASSWORD = "password";
+    private static final String TOKEN = "token";
 
     public static Map<String, String> getQueryMap(String query) {
-        String[] params = query.split("&");
+        String[] params = query.split(AND);
         Map<String, String> map = new HashMap<String, String>();
         for (String param : params) {
-            String[] paramTokens = param.split("=");
+            String[] paramTokens = param.split(EQUALS);
             if (paramTokens != null && paramTokens.length == 2) {
-                String name = param.split("=")[0];
-                String value = param.split("=")[1];
+                String name = paramTokens[0];
+                String value = paramTokens[1];
                 map.put(name, value);
             } else if (paramTokens.length == 3) {
                 // very ugly, added for Xen tunneling url
 
 Review comment:
   Yes. Unfortunately, another ugly legacy.

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


With regards,
Apache Git Services