]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daf: make protocol detection consistent with http module
authorTomas Krizek <tomas.krizek@nic.cz>
Wed, 1 Apr 2020 15:28:41 +0000 (17:28 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Thu, 2 Apr 2020 11:57:33 +0000 (13:57 +0200)
modules/daf/daf.js

index 4c3db79b88e93730ed5f5dc7bf6d4395970dfc0a..05b171b45ef2e9cbf3a69ea61866117d58ba13da 100644 (file)
@@ -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) {