aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/pubsub.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua
index 0370bae2..3a00aae5 100644
--- a/util/pubsub.lua
+++ b/util/pubsub.lua
@@ -6,6 +6,7 @@ local service_mt = {};
local default_config = {
itemstore = function (config, _) return cache.new(config["max_items"]) end;
broadcaster = function () end;
+ itemcheck = function () return true; end;
get_affiliation = function () end;
capabilities = {};
};
@@ -306,6 +307,9 @@ function service:publish(node, actor, id, item)
end
node_obj = self.nodes[node];
end
+ if not self.config.itemcheck(item) then
+ return nil, "internal-server-error";
+ end
local node_data = self.data[node];
local ok = node_data:set(id, item);
if not ok then