mod_pubsub: Send bad-request when no action specified (thanks Maranda)
authorMatthew Wild <mwild1@gmail.com>
Mon, 08 Apr 2013 15:32:24 +0100
changeset 5445 9054b51e71a4
parent 5443 92615cfa2270
child 5446 51686426cac2
child 5447 92b88476873a
mod_pubsub: Send bad-request when no action specified (thanks Maranda)
plugins/mod_pubsub.lua
--- a/plugins/mod_pubsub.lua	Mon Apr 08 15:04:55 2013 +0100
+++ b/plugins/mod_pubsub.lua	Mon Apr 08 15:32:24 2013 +0100
@@ -22,7 +22,9 @@
 	local origin, stanza = event.origin, event.stanza;
 	local pubsub = stanza.tags[1];
 	local action = pubsub.tags[1];
-	if not action then return; end
+	if not action then
+		return origin.send(st.error_reply(stanza, "cancel", "bad-request"));
+	end
 	local handler = handlers[stanza.attr.type.."_"..action.name];
 	if handler then
 		handler(origin, stanza, action);