From: Steven Barth Date: Wed, 20 Aug 2008 19:24:09 +0000 (+0000) Subject: libs/web: Corrected HTTP-Headers X-Git-Tag: 0.8.0~329 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3fdccc976e75d32f0fb11cbc413498bfd2d6c041;p=oweals%2Fluci.git libs/web: Corrected HTTP-Headers --- 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