From eb9fdebd5c6dd999492ca1edcc5241acf3fe0342 Mon Sep 17 00:00:00 2001 From: kzolotarev95 Date: Mon, 6 Jul 2026 20:41:35 +0400 Subject: [PATCH] Preserve proxy prefix for LuCI hub redirect --- files/www/luci-static/resources/view/owrt_remote.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/files/www/luci-static/resources/view/owrt_remote.js b/files/www/luci-static/resources/view/owrt_remote.js index c2b9dce..e9b6f53 100644 --- a/files/www/luci-static/resources/view/owrt_remote.js +++ b/files/www/luci-static/resources/view/owrt_remote.js @@ -21,7 +21,13 @@ return view.extend({ ]); } - var url = '/cgi-bin/owrt-remote?key=' + encodeURIComponent(key); + var path = String((window.location && window.location.pathname) || ''), + proxyPrefix = path.replace(/\/cgi-bin\/luci(?:\/.*)?$/, ''); + + if (proxyPrefix === path) + proxyPrefix = ''; + + var url = proxyPrefix + '/cgi-bin/owrt-remote?key=' + encodeURIComponent(key); window.setTimeout(function() { window.location.replace(url);