summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-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