Changeset

2581:0116672348c4

mod_firewall: Fix syntax error in generated code with some route modification actions
author Matthew Wild <mwild1@gmail.com>
date Sat, 25 Feb 2017 18:36:21 +0000
parents 2580:aaff2716f022
children 2582:ac3140cd89a2
files mod_firewall/actions.lib.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/actions.lib.lua	Sat Feb 25 17:05:40 2017 +0000
+++ b/mod_firewall/actions.lib.lua	Sat Feb 25 18:36:21 2017 +0000
@@ -122,11 +122,11 @@
 local function route_modify(make_new, to, drop)
 	local reroute, deps = "session.send(newstanza)", { "st" };
 	if to then
-		reroute = ("newstanza.attr.to = %q; core_post_stanza(session, newstanza);"):format(to);
+		reroute = ("newstanza.attr.to = %q; core_post_stanza(session, newstanza)"):format(to);
 		deps[#deps+1] = "core_post_stanza";
 	end
-	return ([[local newstanza = st.%s; %s;%s]])
-		:format(make_new, reroute, drop and " do return true end" or ""), deps;
+	return ([[do local newstanza = st.%s; %s;%s end]])
+		:format(make_new, reroute, drop and " return true" or ""), deps;
 end
 
 function action_handlers.BOUNCE(with)