improve https detection

This commit is contained in:
Jakob Ketterl 2019-12-03 18:57:32 +01:00
parent fc8d3d8f11
commit 9d01b2306c
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@
var expectedLocator; var expectedLocator;
if (query.locator) expectedLocator = query.locator; if (query.locator) expectedLocator = query.locator;
var protocol = window.location.protocol == 'https' ? 'wss' : 'ws'; var protocol = window.location.protocol.match(/https/) ? 'wss' : 'ws';
var href = window.location.href; var href = window.location.href;
var index = href.lastIndexOf('/'); var index = href.lastIndexOf('/');

View File

@ -1526,7 +1526,7 @@ function on_ws_error() {
var ws; var ws;
function open_websocket() { function open_websocket() {
var protocol = window.location.protocol == 'https' ? 'wss' : 'ws'; var protocol = window.location.protocol.match(/https/) ? 'wss' : 'ws';
var href = window.location.href; var href = window.location.href;
var index = href.lastIndexOf('/'); var index = href.lastIndexOf('/');