From: Tomas Krizek Date: Wed, 1 Apr 2020 15:28:41 +0000 (+0200) Subject: daf: make protocol detection consistent with http module X-Git-Tag: v5.1.0~21^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6217bee934960a124e2f18298b15fcd3fe6b8807;p=thirdparty%2Fknot-resolver.git daf: make protocol detection consistent with http module --- diff --git a/modules/daf/daf.js b/modules/daf/daf.js index 4c3db79b8..05b171b45 100644 --- a/modules/daf/daf.js +++ b/modules/daf/daf.js @@ -181,8 +181,7 @@ document.addEventListener("DOMContentLoaded", () => { success: loadTable }); /* Listen for counter updates */ - const secure = window.location.protocol == "https"; - const wsStats = (secure ? 'wss://' : 'ws://') + location.host + '/daf'; + const wsStats = ('https:' == document.location.protocol ? 'wss://' : 'ws://') + location.host + '/daf'; const ws = new Socket(wsStats); var lastRateUpdate = Date.now(); ws.onmessage = function(evt) {