* Last API changes before 0.4 API softfreeze
[project/luci.git] / core / src / ffluci / http.lua
index f4ba570..eab12e8 100644 (file)
@@ -33,4 +33,14 @@ if ENV and ENV.HASERLVER then
        require("ffluci.sgi.haserl")
 elseif webuci then
        require("ffluci.sgi.webuci")
+end
+
+-- Asks the browser to redirect to "url"
+function redirect(url, qs)
+       if qs then
+               url = url .. "?" .. qs
+       end
+       
+       ffluci.http.status(302, "Found")
+       print("Location: " .. url .. "\n")
 end
\ No newline at end of file