Avoid XML errors
This commit is contained in:
parent
2bbc4eb3c3
commit
871f07ad2e
3 changed files with 10 additions and 6 deletions
|
@ -192,14 +192,16 @@ end
|
|||
--- Set the mime type of following content data.
|
||||
-- @param mime Mimetype of following content
|
||||
function prepare_content(mime)
|
||||
if mime == "application/xhtml+xml" then
|
||||
if not getenv("HTTP_ACCEPT") or
|
||||
not getenv("HTTP_ACCEPT"):find("application/xhtml+xml", nil, true) then
|
||||
mime = "text/html; charset=UTF-8"
|
||||
if not context.headers or not context.headers["content-type"] then
|
||||
if mime == "application/xhtml+xml" then
|
||||
if not getenv("HTTP_ACCEPT") or
|
||||
not getenv("HTTP_ACCEPT"):find("application/xhtml+xml", nil, true) then
|
||||
mime = "text/html; charset=UTF-8"
|
||||
end
|
||||
header("Vary", "Accept")
|
||||
end
|
||||
header("Vary", "Accept")
|
||||
header("Content-Type", mime)
|
||||
end
|
||||
header("Content-Type", mime)
|
||||
end
|
||||
|
||||
--- Get the RAW HTTP input source
|
||||
|
|
|
@ -213,6 +213,7 @@ function action_upgrade()
|
|||
end
|
||||
end
|
||||
|
||||
luci.http.prepare_content("text/html")
|
||||
luci.template.render("admin_system/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail})
|
||||
end
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ function action_upgrade()
|
|||
end
|
||||
end
|
||||
|
||||
luci.http.prepare_content("text/html")
|
||||
luci.template.render("mini/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail})
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue