Diff

plugins/mod_compression.lua @ 6058:1607b03356ed

mod_compression: Only iterate over correctly named and namespaced child tags of compression feature
author Kim Alvefur <zash@zash.se>
date Thu, 03 Apr 2014 23:48:12 +0200
parent 6057:a3d7b8f4d9c7
child 6367:769a3577dd85
line wrap: on
line diff
--- a/plugins/mod_compression.lua	Thu Apr 03 23:40:20 2014 +0200
+++ b/plugins/mod_compression.lua	Thu Apr 03 23:48:12 2014 +0200
@@ -48,8 +48,8 @@
 				local comp_st = stanza:get_child("compression", xmlns_compression_feature);
 				if comp_st then
 					-- do we support the mechanism
-					for a in comp_st:children() do
-						local algorithm = a[1]
+					for a in comp_st:childtags("method") do
+						local algorithm = a:get_text();
 						if algorithm == "zlib" then
 							session.sends2s(st.stanza("compress", {xmlns=xmlns_compression_protocol}):tag("method"):text("zlib"))
 							session.log("debug", "Enabled compression using zlib.")