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/
--- 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