Preserve proxy prefix for LuCI hub redirect
This commit is contained in:
1 parent
036be640be
commit
eb9fdebd5c
1 file changed
+7
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user