summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-lua-runtime/luasrc/dispatcher.lua
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-lua-runtime/luasrc/dispatcher.lua')
-rw-r--r--modules/luci-lua-runtime/luasrc/dispatcher.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/luci-lua-runtime/luasrc/dispatcher.lua b/modules/luci-lua-runtime/luasrc/dispatcher.lua
index 5c349114c4..f97e84a69b 100644
--- a/modules/luci-lua-runtime/luasrc/dispatcher.lua
+++ b/modules/luci-lua-runtime/luasrc/dispatcher.lua
@@ -6,16 +6,14 @@ module("luci.dispatcher", package.seeall)
local http = _G.L.http
-context = setmetatable({
- request = _G.L.ctx.request_path;
- requested = _G.L.node;
- dispatched = _G.L.node;
-}, {
+context = setmetatable({}, {
__index = function(t, k)
- if k == "requestpath" then
+ if k == "request" or k == "requestpath" then
return _G.L.ctx.request_path
elseif k == "requestargs" then
return _G.L.ctx.request_args
+ elseif k == "requested" or k == "dispatched" then
+ return _G.L.node
else
return _G.L.ctx[k]
end