Mercurial > prosody-modules
comparison mod_invites_page/mod_invites_page.lua @ 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 | 05d0a249326a |
children | 85c11eb4331b |
comparison
equal
deleted
inserted
replaced
4128:879955a32a37 | 4129:ca099bd28bf5 |
---|---|
76 | 76 |
77 function serve_invite_page(event) | 77 function serve_invite_page(event) |
78 local invite_page_template = assert(module:load_resource("html/invite.html")):read("*a"); | 78 local invite_page_template = assert(module:load_resource("html/invite.html")):read("*a"); |
79 local invalid_invite_page_template = assert(module:load_resource("html/invite_invalid.html")):read("*a"); | 79 local invalid_invite_page_template = assert(module:load_resource("html/invite_invalid.html")):read("*a"); |
80 | 80 |
81 event.response.headers["Content-Type"] = "text/html; charset=utf-8"; | |
82 | |
81 local invite = invites.get(event.request.url.query); | 83 local invite = invites.get(event.request.url.query); |
82 if not invite then | 84 if not invite then |
83 return render_html_template(invalid_invite_page_template, { | 85 return render_html_template(invalid_invite_page_template, { |
84 site_name = site_name; | 86 site_name = site_name; |
85 static = base_url.."/static"; | 87 static = base_url.."/static"; |
104 end | 106 end |
105 | 107 |
106 function serve_setup_page(event, app_id) | 108 function serve_setup_page(event, app_id) |
107 local invite_page_template = assert(module:load_resource("html/client.html")):read("*a"); | 109 local invite_page_template = assert(module:load_resource("html/client.html")):read("*a"); |
108 local invalid_invite_page_template = assert(module:load_resource("html/invite_invalid.html")):read("*a"); | 110 local invalid_invite_page_template = assert(module:load_resource("html/invite_invalid.html")):read("*a"); |
111 | |
112 event.response.headers["Content-Type"] = "text/html; charset=utf-8"; | |
109 | 113 |
110 local invite = invites.get(event.request.url.query); | 114 local invite = invites.get(event.request.url.query); |
111 if not invite then | 115 if not invite then |
112 return render_html_template(invalid_invite_page_template, { | 116 return render_html_template(invalid_invite_page_template, { |
113 site_name = site_name; | 117 site_name = site_name; |