From: Zheng Qian Date: Mon, 10 Dec 2018 09:45:55 +0000 (+0800) Subject: luci-app-aria2: fix http/https protocol when opening aria2 webUI X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=refs%2Fpull%2F2363%2Fhead;hp=1b26c91a085c68d628b3098e52e85fb5f30b9af0;p=oweals%2Fluci.git luci-app-aria2: fix http/https protocol when opening aria2 webUI In the openWebUI function, the url is assumed as http protocol, this will cause problem when we login luci-admin with https. The variable localhostPath has already contained http/https protocol, so we can use it directly and add the path of aria2 webUI. Signed-off-by: Zheng Qian --- diff --git a/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm index 34b7b3c64..a06d2015f 100644 --- a/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm +++ b/applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm @@ -67,7 +67,7 @@ function openWebUI(path) { var pathName = window.document.location.pathname; var pos = curWwwPath.indexOf(pathName); var localhostPath = curWwwPath.substring(0, pos); - var url = "http:" + localhostPath.substring(window.location.protocol.length) + "/" + path; + var url = localhostPath + "/" + path; window.open(url) }; //]]>