]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
use js scheme detection
authorSH <sh@analogic.cz>
Thu, 6 Feb 2020 15:24:38 +0000 (16:24 +0100)
committerSH <sh@analogic.cz>
Thu, 6 Feb 2020 15:24:38 +0000 (16:24 +0100)
modules/http/http.lua.in
modules/http/static/kresd.js
modules/http/static/main.tpl

index 4e6967cd853e11a416b215a025970df8e7a86e91..7d022a448ec50226b9389b06eb9c713838dd5bcb 100644 (file)
@@ -115,7 +115,6 @@ local function serve_root()
                end
                -- Return index page
                return data
-                       :gsub('{{ secure }}', stream:checktls() and 'true' or 'false')
                        :gsub('{{ snippets }}', table.concat(rsnippets, '\n'))
        end
 end
index ceb16ed1a550796bbd23c981018484711881436c..4b4047f4eb2cd032212caab9179e68828e6da96a 100644 (file)
@@ -332,7 +332,7 @@ $(function() {
        }
 
        /* WebSocket endpoints */
-       var wsStats = (secure ? 'wss://' : 'ws://') + location.host + '/stats';
+       var wsStats = ('https:' == document.location.protocol ? 'wss://' : 'ws://') + location.host + '/stats';
        var ws = new Socket(wsStats);
        ws.onmessage = function(evt) {
                var data = JSON.parse(evt.data);
index d05522cb5a90189517ed46abb373445afa53e5ac..c6bdab32163fd4117d368e0696d2591ff62706d6 100644 (file)
@@ -4,7 +4,6 @@
 <title>{{ title }}</title>
 <script type="text/javascript">
        var host = "{{ host }}";
-       var secure = {{ secure }};
 </script>
 <script src="jquery.js"></script>
 <script src="bootstrap.min.js"></script>