summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/web/luasrc')
-rw-r--r--libs/web/luasrc/http.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/libs/web/luasrc/http.lua b/libs/web/luasrc/http.lua
index 6b73b9414c..c5a85ea4d9 100644
--- a/libs/web/luasrc/http.lua
+++ b/libs/web/luasrc/http.lua
@@ -192,14 +192,16 @@ 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"
+ if not context.headers or not context.headers["content-type"] then
+ 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("Vary", "Accept")
+ header("Content-Type", mime)
end
- header("Content-Type", mime)
end
--- Get the RAW HTTP input source