From 9d01b2306c4d178eb866dc7039e6b2a84a8c69ed Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 3 Dec 2019 18:57:32 +0100 Subject: [PATCH] improve https detection --- htdocs/map.js | 2 +- htdocs/openwebrx.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/map.js b/htdocs/map.js index c912a14d..95cfa97b 100644 --- a/htdocs/map.js +++ b/htdocs/map.js @@ -13,7 +13,7 @@ var expectedLocator; 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 index = href.lastIndexOf('/'); diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index b30a6050..25c094c0 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1526,7 +1526,7 @@ function on_ws_error() { var ws; 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 index = href.lastIndexOf('/');