Mercurial > prosody-modules
diff mod_invite/mod_invite.lua @ 3552:5370bc374c83
mod_invite: Use path passed by http stack instead of pattern matching
Otherwise this breaks in case http_paths is used to serve from a different path than /invite/
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 05 Apr 2019 19:06:20 +0200 |
parents | b059a3fb2a58 |
children | 5b15ce870a5b |
line wrap: on
line diff
--- a/mod_invite/mod_invite.lua Fri Apr 05 19:02:43 2019 +0200 +++ b/mod_invite/mod_invite.lua Fri Apr 05 19:06:20 2019 +0200 @@ -34,13 +34,11 @@ end) end -function generate_page(event) +function generate_page(event, token) local request, response = event.request, event.response; local tokens = invite_storage:get() or {}; - local token = request.path:match("^/invite/([^/]*)$"); - response.headers.content_type = "text/html; charset=utf-8"; if not token or not tokens[token] then