summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--modules/luci-base/ucode/dispatcher.uc5
-rw-r--r--modules/luci-lua-runtime/luasrc/dispatcher.lua2
2 files changed, 3 insertions, 4 deletions
diff --git a/modules/luci-base/ucode/dispatcher.uc b/modules/luci-base/ucode/dispatcher.uc
index b08a2f8b7a..c996c76af1 100644
--- a/modules/luci-base/ucode/dispatcher.uc
+++ b/modules/luci-base/ucode/dispatcher.uc
@@ -856,7 +856,7 @@ dispatch = function(_http, path) {
let version = determine_version();
let lang = determine_request_language();
- runtime = LuCIRuntime({
+ runtime = runtime || LuCIRuntime({
http,
ubus,
uci,
@@ -892,7 +892,8 @@ dispatch = function(_http, path) {
let resolved = resolve_page(menu, path);
runtime.env.ctx = resolved.ctx;
- runtime.env.node = resolved.node;
+ runtime.env.dispatched = resolved.node;
+ runtime.env.requested ??= resolved.node;
if (length(resolved.ctx.auth)) {
let session = is_authenticated(resolved.ctx.auth);
diff --git a/modules/luci-lua-runtime/luasrc/dispatcher.lua b/modules/luci-lua-runtime/luasrc/dispatcher.lua
index f97e84a69b..608b9b6674 100644
--- a/modules/luci-lua-runtime/luasrc/dispatcher.lua
+++ b/modules/luci-lua-runtime/luasrc/dispatcher.lua
@@ -12,8 +12,6 @@ context = setmetatable({}, {
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