luci-app-aria2: fix http/https protocol when opening aria2 webUI 2363/head
authorZheng Qian <sotux82@gmail.com>
Mon, 10 Dec 2018 09:45:55 +0000 (17:45 +0800)
committerZheng Qian <sotux82@gmail.com>
Mon, 10 Dec 2018 09:45:55 +0000 (17:45 +0800)
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 <sotux82@gmail.com>
applications/luci-app-aria2/luasrc/view/aria2/overview_status.htm

index 34b7b3c641c6ced605d8e4382f8346a2a75d47df..a06d2015ffe91a56e0aa4efa81facc1d8f4c490f 100644 (file)
@@ -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)
 };
 //]]>