mod_proxy65: Only handle service discovery requests when no node is present in the request.
authorWaqas Hussain <waqas20@gmail.com>
Tue, 26 Feb 2013 23:57:44 +0500
changeset 5336 eeb24f1e2c84
parent 5335 bb81c13d2c6f
child 5337 c22dd451487f
mod_proxy65: Only handle service discovery requests when no node is present in the request.
plugins/mod_proxy65.lua
--- a/plugins/mod_proxy65.lua	Tue Feb 26 23:56:44 2013 +0500
+++ b/plugins/mod_proxy65.lua	Tue Feb 26 23:57:44 2013 +0500
@@ -106,16 +106,20 @@
 	
 	module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function(event)
 		local origin, stanza = event.origin, event.stanza;
-		origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#info")
-			:tag("identity", {category='proxy', type='bytestreams', name=name}):up()
-			:tag("feature", {var="http://jabber.org/protocol/bytestreams"}) );
-		return true;
+		if not stanza.tags[1].attr.node then
+			origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#info")
+				:tag("identity", {category='proxy', type='bytestreams', name=name}):up()
+				:tag("feature", {var="http://jabber.org/protocol/bytestreams"}) );
+			return true;
+		end
 	end, -1);
 	
 	module:hook("iq-get/host/http://jabber.org/protocol/disco#items:query", function(event)
 		local origin, stanza = event.origin, event.stanza;
-		origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#items"));
-		return true;
+		if not stanza.tags[1].attr.node then
+			origin.send(st.reply(stanza):query("http://jabber.org/protocol/disco#items"));
+			return true;
+		end
 	end, -1);
 	
 	module:hook("iq-get/host/http://jabber.org/protocol/bytestreams:query", function(event)