diff mod_firewall/definitions.lib.lua @ 5233:7eec2bc67c26

mod_firewall: Warn about invalid pubsubitemid list specification
author Matthew Wild <mwild1@gmail.com>
date Sat, 11 Mar 2023 16:40:24 +0000
parents 0f943619e01a
children
line wrap: on
line diff
--- a/mod_firewall/definitions.lib.lua	Sat Mar 11 16:40:09 2023 +0000
+++ b/mod_firewall/definitions.lib.lua	Sat Mar 11 16:40:24 2023 +0000
@@ -198,6 +198,10 @@
 	pubsubitemid = {
 		init = function(self, pubsub_spec, opts)
 			local service_addr, node = pubsub_spec:match("^pubsubitemid:([^/]*)/(.*)");
+			if not service_addr then
+				module:log("warn", "Invalid list specification (expected 'pubsubitemid:<service>/<node>', got: '%s')", pubsub_spec);
+				return;
+			end
 			module:depends("pubsub_subscription");
 			module:add_item("pubsub-subscription", {
 					service = service_addr;