aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-27 13:28:34 +0200
committerKim Alvefur <zash@zash.se>2017-10-27 13:28:34 +0200
commit5f3a7673367a25aee857aa18906bf5c376ed5848 (patch)
treedd735f056d10327784bc7b376a7bc2709df2bd1d
parente9b828c3f14f7c2a13043c02939498027b5616e9 (diff)
downloadprosody-im-server-5f3a7673367a25aee857aa18906bf5c376ed5848.zip
prosody-im-server-5f3a7673367a25aee857aa18906bf5c376ed5848.tar
mod_http_errors: Set Content-Type header to HTML (fixes #1030)
-rw-r--r--plugins/mod_http_errors.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_http_errors.lua b/plugins/mod_http_errors.lua
index 17d357e5..d8646268 100644
--- a/plugins/mod_http_errors.lua
+++ b/plugins/mod_http_errors.lua
@@ -72,5 +72,8 @@ local function get_page(code, extra)
end
module:hook_object_event(server, "http-error", function (event)
+ if event.response then
+ event.response.headers.content_type = "text/html; charset=utf-8";
+ end
return get_page(event.code, (show_private and event.private_message) or event.message);
end);