mod_http_muc_log/mod_http_muc_log.lua
changeset 5594 b681948a01f1
parent 5585 df483d9056f5
child 5660 c20b77e5e032
--- a/mod_http_muc_log/mod_http_muc_log.lua	Mon Jul 10 07:16:54 2023 +0200
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Mon Jul 10 16:10:57 2023 +0200
@@ -294,10 +294,16 @@
 local function logs_page(event, path)
 	local request, response = event.request, event.response;
 
-	local room, date = path:match("^([^/]+)/([^/]*)/?$");
-	if not room then
+	-- /room --> 303 /room/
+	-- /room/ --> calendar view
+	-- /room/yyyy-mm-dd --> logs view
+	-- /room/yyyy-mm-dd/* --> 404
+	local room, date = path:match("^([^/]+)/([^/]*)$");
+	if not room and not path:find"/" then
 		response.headers.location = url.build({ path = path .. "/" });
 		return 303;
+	elseif not room then
+		return 404;
 	end
 	room = nodeprep(room);
 	if not room then