summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/luci.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js
index 3e40b304b6..1f883ab802 100644
--- a/modules/luci-base/htdocs/luci-static/resources/luci.js
+++ b/modules/luci-base/htdocs/luci-static/resources/luci.js
@@ -762,10 +762,12 @@
}
if (rpcBaseURL == null) {
+ var rpcFallbackURL = this.url('admin/ubus');
+
rpcBaseURL = Request.get('/ubus/').then(function(res) {
- return (rpcBaseURL = (res.status == 400) ? '/ubus/' : this.url('admin/ubus'));
+ return (rpcBaseURL = (res.status == 400) ? '/ubus/' : rpcFallbackURL);
}, function() {
- return (rpcBaseURL = L.url('admin/ubus'));
+ return (rpcBaseURL = rpcFallbackURL);
}).then(function(url) {
try {
window.sessionStorage.setItem('rpcBaseURL', url);