Optionally read path from cookie

Permit a server to set a fallback path to the websocket without altering the URL via query string or hash fragment. The cookie takes least precedence and is named following the convention of the input id in vnc.html.
This commit is contained in:
Ryan Lovett 2018-04-17 23:13:52 -07:00 committed by GitHub
parent 24231f1ae3
commit 1098cb106b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -187,7 +187,11 @@
}
var password = WebUtil.getConfigVar('password', '');
var path = WebUtil.getConfigVar('path', 'websockify');
var path = WebUtil.getConfigVar('path', null);
if (!path) {
path = WebUtil.readCookie('noVNC_setting_path', 'websockify');
}
// If a token variable is passed in, set the parameter in a cookie.
// This is used by nova-novncproxy.