summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2018-05-20 19:51:33 +0200
committerAnsuel Smith <ansuelsmth@gmail.com>2018-05-23 02:52:08 +0200
commitda1e655294163bd7341d234ac5cc8b070690b28a (patch)
treede341b637a162907a5c6fcdeffa241d3456c94a9 /modules
parentba8e7fd7bc96f827ead768cd168579ab54ef825f (diff)
luci-base: fix dispacher fail
http.getenv("SCRIPT_NAME") fail if it's not provided. This can happen in the login screen when we don't have any script to load. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/luasrc/dispatcher.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua
index 45e1e308f..2c58b0ab3 100644
--- a/modules/luci-base/luasrc/dispatcher.lua
+++ b/modules/luci-base/luasrc/dispatcher.lua
@@ -358,7 +358,7 @@ function dispatch(request)
elseif key == "REQUEST_URI" then
return build_url(unpack(ctx.requestpath))
elseif key == "FULL_REQUEST_URI" then
- local url = { http.getenv("SCRIPT_NAME"), http.getenv("PATH_INFO") }
+ local url = { http.getenv("SCRIPT_NAME") or "" , http.getenv("PATH_INFO") }
local query = http.getenv("QUERY_STRING")
if query and #query > 0 then
url[#url+1] = "?"