projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2085193
)
Redirect to root on empty path
535/head
author
Joel Pedraza
<github@saik0.net>
Fri, 30 Oct 2015 15:22:15 +0000
(11:22 -0400)
committer
Joel Pedraza
<joel@joelpedraza.com>
Tue, 3 Nov 2015 14:53:39 +0000
(09:53 -0500)
* 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>
modules/luci-base/luasrc/http.lua
patch
|
blob
|
history
diff --git
a/modules/luci-base/luasrc/http.lua
b/modules/luci-base/luasrc/http.lua
index a92d8affb65628505751ab80f705aa58e966de7a..4b357317272eec507110f8b674be85ec84d9541b 100644
(file)
--- 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()