From: Ansuel Smith Date: Sun, 20 May 2018 17:51:33 +0000 (+0200) Subject: luci-base: fix dispacher fail X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=refs%2Fpull%2F1814%2Fhead;p=oweals%2Fluci.git 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 --- 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] = "?"