summaryrefslogtreecommitdiffhomepage
path: root/core/src/ffluci
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-05-07 21:16:35 +0000
committerSteven Barth <steven@midlink.org>2008-05-07 21:16:35 +0000
commita3a51464fd8cffa6d18fa3f18be9c699901abd0d (patch)
treefb5a8d3904677f63a82d48a1314a5c6b7e9c94f0 /core/src/ffluci
parent0120aec28526235d5efce2bbb12bc0e89cae6352 (diff)
Diffstat (limited to 'core/src/ffluci')
-rw-r--r--core/src/ffluci/http.lua10
-rw-r--r--core/src/ffluci/sgi/haserl.lua7
-rw-r--r--core/src/ffluci/sgi/webuci.lua7
3 files changed, 14 insertions, 10 deletions
diff --git a/core/src/ffluci/http.lua b/core/src/ffluci/http.lua
index eab12e8f83..f4ba570946 100644
--- a/core/src/ffluci/http.lua
+++ b/core/src/ffluci/http.lua
@@ -33,14 +33,4 @@ 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
diff --git a/core/src/ffluci/sgi/haserl.lua b/core/src/ffluci/sgi/haserl.lua
index 6fefd7baf8..7e9854d7d3 100644
--- a/core/src/ffluci/sgi/haserl.lua
+++ b/core/src/ffluci/sgi/haserl.lua
@@ -63,6 +63,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("Status: " .. tostring(code) .. " " .. message)
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)