Changeset

4129:ca099bd28bf5

mod_invites_page, mod_invites_register_web: Set correct Content-Type everywhere necessary
author Matthew Wild <mwild1@gmail.com>
date Tue, 15 Sep 2020 14:11:48 +0100
parents 4128:879955a32a37
children 4130:f4a79b081c66
files mod_invites_page/mod_invites_page.lua mod_invites_register_web/mod_invites_register_web.lua
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_invites_page/mod_invites_page.lua	Tue Sep 15 11:54:48 2020 +0100
+++ b/mod_invites_page/mod_invites_page.lua	Tue Sep 15 14:11:48 2020 +0100
@@ -78,6 +78,8 @@
 	local invite_page_template = assert(module:load_resource("html/invite.html")):read("*a");
 	local invalid_invite_page_template = assert(module:load_resource("html/invite_invalid.html")):read("*a");
 
+	event.response.headers["Content-Type"] = "text/html; charset=utf-8";
+
 	local invite = invites.get(event.request.url.query);
 	if not invite then
 		return render_html_template(invalid_invite_page_template, {
@@ -107,6 +109,8 @@
 	local invite_page_template = assert(module:load_resource("html/client.html")):read("*a");
 	local invalid_invite_page_template = assert(module:load_resource("html/invite_invalid.html")):read("*a");
 
+	event.response.headers["Content-Type"] = "text/html; charset=utf-8";
+
 	local invite = invites.get(event.request.url.query);
 	if not invite then
 		return render_html_template(invalid_invite_page_template, {
--- a/mod_invites_register_web/mod_invites_register_web.lua	Tue Sep 15 11:54:48 2020 +0100
+++ b/mod_invites_register_web/mod_invites_register_web.lua	Tue Sep 15 14:11:48 2020 +0100
@@ -34,6 +34,8 @@
 		};
 	end
 
+	event.response.headers["Content-Type"] = "text/html; charset=utf-8";
+
 	local invite_page = render_html_template(register_page_template, {
 		site_name = site_name;
 		token = invite.token;
@@ -66,7 +68,7 @@
 		};
 	end
 
-	response.headers.content_type = "text/html; charset=utf-8";
+	event.response.headers["Content-Type"] = "text/html; charset=utf-8";
 
 	if not user or #user == 0 or not password or #password == 0 or not token then
 		return render_html_template(register_page_template, {