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>
This commit is contained in:
parent
ba8e7fd7bc
commit
da1e655294
1 changed files with 1 additions and 1 deletions
|
@ -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] = "?"
|
||||
|
|
Loading…
Reference in a new issue