diff options
author | Joel Pedraza <github@saik0.net> | 2015-10-30 11:22:15 -0400 |
---|---|---|
committer | Joel Pedraza <joel@joelpedraza.com> | 2015-11-03 09:53:39 -0500 |
commit | 5541065793913f8bf201123440e4a827ec779ebd (patch) | |
tree | 90384abae132c43033edb652b71a77f282658063 /modules/luci-base/luasrc/http.lua | |
parent | 20851933bf31579be72cf593a22e00e33ee9105b (diff) |
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 <github@saik0.net>
Diffstat (limited to 'modules/luci-base/luasrc/http.lua')
-rw-r--r-- | modules/luci-base/luasrc/http.lua | 1 |
1 files changed, 1 insertions, 0 deletions
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() |