From 3fdccc976e75d32f0fb11cbc413498bfd2d6c041 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Wed, 20 Aug 2008 19:24:09 +0000 Subject: [PATCH] libs/web: Corrected HTTP-Headers --- libs/web/luasrc/http.lua | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.25.1