summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-base')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/luci.js10
1 files changed, 8 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 83c2807d7..faed3aa6d 100644
--- a/modules/luci-base/htdocs/luci-static/resources/luci.js
+++ b/modules/luci-base/htdocs/luci-static/resources/luci.js
@@ -2553,10 +2553,16 @@
rpcBaseURL = Session.getLocalData('rpcBaseURL');
if (rpcBaseURL == null) {
+ var msg = {
+ jsonrpc: '2.0',
+ id: 'init',
+ method: 'list',
+ params: undefined
+ };
var rpcFallbackURL = this.url('admin/ubus');
- rpcBaseURL = Request.get(env.ubuspath).then(function(res) {
- return (rpcBaseURL = (res.status == 400) ? env.ubuspath : rpcFallbackURL);
+ rpcBaseURL = Request.post(env.ubuspath, msg, { nobatch: true }).then(function(res) {
+ return (rpcBaseURL = res.status == 200 ? env.ubuspath : rpcFallbackURL);
}, function() {
return (rpcBaseURL = rpcFallbackURL);
}).then(function(url) {