diff --git a/guacamole-tunnel/src/main/webapp/index.xhtml b/guacamole-tunnel/src/main/webapp/index.xhtml index 7622c3dc..90a64f90 100644 --- a/guacamole-tunnel/src/main/webapp/index.xhtml +++ b/guacamole-tunnel/src/main/webapp/index.xhtml @@ -177,13 +177,15 @@ var params = {}, re=/[^?]*\?([^&]*)&(.*)/; - params.data = res[1] - params.data = res[2] + var res = re.exec(qs); + + params.data = res[1]; + params.exit = res[2]; return params; } - window.query = getQueryParams(document.location); + window.query = getQueryParams(document.location.href); // Sanity check Guacamole JavaScript API version // if (Guacamole.API_VERSION !== "0.9.1") diff --git a/guacamole-tunnel/src/main/webapp/scripts/client-ui.js b/guacamole-tunnel/src/main/webapp/scripts/client-ui.js index 286dbb54..291165b2 100644 --- a/guacamole-tunnel/src/main/webapp/scripts/client-ui.js +++ b/guacamole-tunnel/src/main/webapp/scripts/client-ui.js @@ -998,8 +998,13 @@ GuacUI.Client.connect = function() { // all parameters should be preserved and passed on for // the sake of authentication. + var queryArr = []; + for( k in window.query ) { + queryArr.push(k+"="+window.query[k]) + } + var connect_string = - window.location.search.substring(1) + queryArr.join('&') + "&width=" + Math.floor(optimal_width) + "&height=" + Math.floor(optimal_height) + "&dpi=" + Math.floor(optimal_dpi); @@ -1028,6 +1033,7 @@ GuacUI.Client.connect = function() { window.location = window.query.exit; }; + console.log(connect_string); // Connect guac.connect(connect_string);