# HG changeset patch # User Kim Alvefur # Date 1554483980 -7200 # Node ID 5370bc374c83979eb2c4c800fa70a16093e239c6 # Parent 7fc6a63c3bd00a33e05e6d49ef0bbea301a7e230 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/ diff -r 7fc6a63c3bd0 -r 5370bc374c83 mod_invite/mod_invite.lua --- 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