Pass token into the path variable

Fixes #536
This commit is contained in:
Miguel Xavier Penha Neto 2015-10-01 17:26:44 -03:00
parent a0e7ab43dc
commit 3f3ef04515
1 changed files with 9 additions and 3 deletions

View File

@ -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;