mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
bug 7228: the exception found in this bug actually does not affect normal function but rather a ugly log message. add some protection to ignore invalid parameter from URL
This commit is contained in:
parent
864c35d615
commit
92815fc9f7
@ -185,10 +185,16 @@ public class ConsoleProxyAjaxHandler implements HttpHandler {
|
||||
public static Map<String, String> getQueryMap(String query) {
|
||||
String[] params = query.split("&");
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
for (String param : params) {
|
||||
String name = param.split("=")[0];
|
||||
String value = param.split("=")[1];
|
||||
map.put(name, value);
|
||||
for (String param : params) {
|
||||
String[] paramTokens = param.split("=");
|
||||
if(paramTokens != null && paramTokens.length == 2) {
|
||||
String name = param.split("=")[0];
|
||||
String value = param.split("=")[1];
|
||||
map.put(name, value);
|
||||
} else {
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Invalid paramemter in URL found. param: " + param);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user