diff options
author | Steven Barth <steven@midlink.org> | 2008-08-20 19:24:09 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-08-20 19:24:09 +0000 |
commit | 3fdccc976e75d32f0fb11cbc413498bfd2d6c041 (patch) | |
tree | 0686664b3f0e467f8c844cbaee391454f56581f2 /libs | |
parent | 0e1ec77d17f262c20d87d3e289a67cd9dc4ba10e (diff) |
libs/web: Corrected HTTP-Headers
Diffstat (limited to 'libs')
-rw-r--r-- | libs/web/luasrc/http.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/web/luasrc/http.lua b/libs/web/luasrc/http.lua index 4fa643865..5b922d994 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 |