mirror of https://git.openwrt.org/project/luci.git
This commit is contained in:
parent
0120aec285
commit
a3a51464fd
|
@ -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
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue