From 3f3ef045156dc6ba6e2089ccc3f5be41f8fefbf6 Mon Sep 17 00:00:00 2001 From: Miguel Xavier Penha Neto Date: Thu, 1 Oct 2015 17:26:44 -0300 Subject: [PATCH] Pass token into the path variable Fixes #536 --- vnc_auto.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vnc_auto.html b/vnc_auto.html index 86cfde75..87d21bb7 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -200,16 +200,22 @@ } } + password = WebUtil.getQueryVar('password', ''); + path = WebUtil.getQueryVar('path', 'websockify'); + // If a token variable is passed in, set the parameter in a cookie. // This is used by nova-novncproxy. token = WebUtil.getQueryVar('token', null); if (token) { + + if (path.indexOf("?") > -1) + path += "&token=" + token; //there is a query string already + else + path += "?token=" + token; + WebUtil.createCookie('token', token, 1) } - password = WebUtil.getQueryVar('password', ''); - path = WebUtil.getQueryVar('path', 'websockify'); - if ((!host) || (!port)) { updateState(null, 'fatal', null, 'Must specify host and port in URL'); return;