diff options
Diffstat (limited to 'libs/web/luasrc')
-rw-r--r-- | libs/web/luasrc/dispatcher.lua | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index 840dbf3c26..9ba74c49c9 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -126,9 +126,12 @@ function dispatch(request) local c = context.tree local track = {} + local args = {} + local n for i, s in ipairs(request) do c = c.nodes[s] + n = i if not c or c.leaf then break end @@ -138,6 +141,12 @@ function dispatch(request) end end + if c and c.leaf then + for j=n+1, #request do + table.insert(args, request[j]) + end + end + if track.i18n then require("luci.i18n").loadc(track.i18n) end @@ -190,7 +199,7 @@ function dispatch(request) luci.util.updfenv(c.target, mod) end - stat, err = luci.util.copcall(c.target) + stat, err = luci.util.copcall(c.target, unpack(args)) if not stat then error500(err) end @@ -430,8 +439,8 @@ function cbi(model) require("luci.cbi") require("luci.template") - return function() - local stat, maps = luci.util.copcall(luci.cbi.load, model) + return function(...) + local stat, maps = luci.util.copcall(luci.cbi.load, model, ...) if not stat then error500(maps) return true |