commit 8e3ae038f872b80ffaeb064d8f331d630de1ddcd
parent af0cbfbf6ca9cd2f666e64260e04c8b4177ea7df
Author: Marco Duiker <md@md-kwadraat.nl>
Date: Thu, 18 Apr 2019 12:02:05 +0200
Update main.js
in this way we can use query string parameters on index.html without websocket errors
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js
@@ -210,7 +210,7 @@ jQuery(function($){
return;
}
- var ws_url = window.location.href.replace('http', 'ws'),
+ var ws_url = window.location.href.split('?')[0].replace('http', 'ws'),
join = (ws_url[ws_url.length-1] === '/' ? '' : '/'),
url = ws_url + join + 'ws?id=' + msg.id,
sock = new window.WebSocket(url),