Changeset

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 3551:7fc6a63c3bd0
children 3553:5b15ce870a5b
files mod_invite/mod_invite.lua
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
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