X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=core%2Fsrc%2Fffluci%2Fsgi%2Fwebuci.lua;h=5e17ab7935607a092593e613f67669cd58166a16;hp=87bb69302c915d03d2e9d6cbd1fc7c222fe0eb86;hb=a3a51464fd8cffa6d18fa3f18be9c699901abd0d;hpb=0120aec28526235d5efce2bbb12bc0e89cae6352 diff --git a/core/src/ffluci/sgi/webuci.lua b/core/src/ffluci/sgi/webuci.lua index 87bb69302c..5e17ab7935 100644 --- a/core/src/ffluci/sgi/webuci.lua +++ b/core/src/ffluci/sgi/webuci.lua @@ -69,6 +69,13 @@ function ffluci.http.prepare_content(type) print("Content-Type: "..type.."\n") end +-- Asks the browser to redirect to "url" +function ffluci.http.redirect(url) + ffluci.http.status(302, "Found") + ffluci.http.header("Location", url) + print() +end + -- Sets HTTP-Status-Header function ffluci.http.status(code, message) print(webuci.env.SERVER_PROTOCOL .. " " .. tostring(code) .. " " .. message)