summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/http.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-20 19:24:09 +0000
committerSteven Barth <steven@midlink.org>2008-08-20 19:24:09 +0000
commit3fdccc976e75d32f0fb11cbc413498bfd2d6c041 (patch)
tree0686664b3f0e467f8c844cbaee391454f56581f2 /libs/web/luasrc/http.lua
parent0e1ec77d17f262c20d87d3e289a67cd9dc4ba10e (diff)
libs/web: Corrected HTTP-Headers
Diffstat (limited to 'libs/web/luasrc/http.lua')
-rw-r--r--libs/web/luasrc/http.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/web/luasrc/http.lua b/libs/web/luasrc/http.lua
index 4fa6438653..5b922d9943 100644
--- a/libs/web/luasrc/http.lua
+++ b/libs/web/luasrc/http.lua
@@ -172,6 +172,13 @@ 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"
+ end
+ header("Vary", "Accept")
+ end
header("Content-Type", mime)
end