From d69d8cfa7a4d15fb081aede9e2b3e49a21fb8435 Mon Sep 17 00:00:00 2001 From: Sheng Date: Sat, 27 Apr 2019 00:01:48 +0800 Subject: [PATCH] Fixed a bug caused by url containing hashes --- webssh/static/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js index 013ce4c..f37d68f 100644 --- 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.split('?')[0].replace('http', 'ws'), + var ws_url = window.location.href.split(/\?|#/, 1)[0].replace('http', 'ws'), join = (ws_url[ws_url.length-1] === '/' ? '' : '/'), url = ws_url + join + 'ws?id=' + msg.id, sock = new window.WebSocket(url),