From: SH Date: Thu, 6 Feb 2020 15:24:38 +0000 (+0100) Subject: use js scheme detection X-Git-Tag: v5.1.0~48^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4aa7b95a9c65e1986b9626c1d95523be57852492;p=thirdparty%2Fknot-resolver.git use js scheme detection --- diff --git a/modules/http/http.lua.in b/modules/http/http.lua.in index 4e6967cd8..7d022a448 100644 --- a/modules/http/http.lua.in +++ b/modules/http/http.lua.in @@ -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 diff --git a/modules/http/static/kresd.js b/modules/http/static/kresd.js index ceb16ed1a..4b4047f4e 100644 --- a/modules/http/static/kresd.js +++ b/modules/http/static/kresd.js @@ -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); diff --git a/modules/http/static/main.tpl b/modules/http/static/main.tpl index d05522cb5..c6bdab321 100644 --- a/modules/http/static/main.tpl +++ b/modules/http/static/main.tpl @@ -4,7 +4,6 @@ {{ title }}