From 5541065793913f8bf201123440e4a827ec779ebd Mon Sep 17 00:00:00 2001 From: Joel Pedraza Date: Fri, 30 Oct 2015 11:22:15 -0400 Subject: Redirect to root on empty path * Prevents an empty Location header * Useful in environments where build_url() could return an empty string (such as http server rewrites requests to /cgi-bin/luci) Signed-off-by: Joel Pedraza --- modules/luci-base/luasrc/http.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/luci-base/luasrc/http.lua b/modules/luci-base/luasrc/http.lua index a92d8affb..4b3573172 100644 --- a/modules/luci-base/luasrc/http.lua +++ b/modules/luci-base/luasrc/http.lua @@ -208,6 +208,7 @@ function splice(fd, size) end function redirect(url) + if url == "" then url = "/" end status(302, "Found") header("Location", url) close() -- cgit v1.2.3