summaryrefslogtreecommitdiffhomepage
path: root/libs/luci-lib-base/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-11-04 16:06:18 +0100
committerJo-Philipp Wich <jo@mein.io>2022-11-04 16:10:12 +0100
commit911845231380e8e4ecd5151493a561b1a3bfb4ad (patch)
tree2b2b91f0e6263cf99c40a5464e82f442403e81e4 /libs/luci-lib-base/luasrc
parenta145e489fd955c36710d5db77010e750271aa7e9 (diff)
luci-lib-base: ensure that `luci.http` can be required standalone
Various existing Lua software is requiring the `luci.http` library for URL encoding/decoding tasks so ensure that it can be loaded in a stand alone manner even if the emulated Lua runtime environment is not available. Fixes: cea2c3578e ("luci-lib-base: forward luci.http.context.request.message to ucode") Ref: https://forum.openwrt.org/t/x/141817 Ref: https://github.com/openwrt/luci/pull/5976#issuecomment-1296220586 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'libs/luci-lib-base/luasrc')
-rw-r--r--libs/luci-lib-base/luasrc/http.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/luci-lib-base/luasrc/http.lua b/libs/luci-lib-base/luasrc/http.lua
index 3b0865082d..882b71c8f7 100644
--- a/libs/luci-lib-base/luasrc/http.lua
+++ b/libs/luci-lib-base/luasrc/http.lua
@@ -140,6 +140,6 @@ context = {
content = function(self, ...) return content(...) end;
getcookie = function(self, ...) return getcookie(...) end;
setfilehandler = function(self, ...) return setfilehandler(...) end;
- message = L.http.message
+ message = L and L.http.message
}
}