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>
This commit is contained in:
parent
20851933bf
commit
5541065793
1 changed files with 1 additions and 0 deletions
|
@ -208,6 +208,7 @@ function splice(fd, size)
|
|||
end
|
||||
|
||||
function redirect(url)
|
||||
if url == "" then url = "/" end
|
||||
status(302, "Found")
|
||||
header("Location", url)
|
||||
close()
|
||||
|
|
Loading…
Reference in a new issue