mod_firewall/conditions.lib.lua
changeset 2113 9db4113d0cb5
parent 2111 f445f43b9ba1
child 2120 2bb42ba342f3
--- a/mod_firewall/conditions.lib.lua	Thu Mar 17 11:33:57 2016 +0000
+++ b/mod_firewall/conditions.lib.lua	Thu Mar 17 11:37:19 2016 +0000
@@ -95,7 +95,12 @@
 
 function condition_handlers.INSPECT(path)
 	if path:find("=") then
-		return ("stanza:find(%q) == %q"):format(path:match("(.-)=(.*)"));
+		local query, is_pattern_match, value = path:match("(.-)(~?)=(.*)");
+		if is_pattern_match ~= "" then
+			return ("stanza:find(%q):match(%q)"):format(path:match("(.-)~=(.*)"));
+		else
+			return ("stanza:find(%q) == %q"):format(path:match("(.-)=(.*)"));
+		end
 	end
 	return ("stanza:find(%q)"):format(path);
 end