# HG changeset patch # User Kim Alvefur # Date 1578072550 -3600 # Node ID 0d4146cf9fbc4624efb8e15f2d3e5d2386c04c1f # Parent 435f5b4ebd065df10b6d0275ab72a796950d70c9 mod_rest: Enforce single child policy for outgoing it stanzas diff -r 435f5b4ebd06 -r 0d4146cf9fbc mod_rest/mod_rest.lua --- a/mod_rest/mod_rest.lua Fri Jan 03 16:33:40 2020 +0100 +++ b/mod_rest/mod_rest.lua Fri Jan 03 18:29:10 2020 +0100 @@ -106,6 +106,8 @@ if payload.name == "iq" then if payload.attr.type ~= "get" and payload.attr.type ~= "set" then return errors.new({ code = 422, text = "'iq' stanza must be of type 'get' or 'set'" }); + elseif #payload.tags ~= 1 then + return errors.new({ code = 422, text = "'iq' stanza must have exactly one child tag" }); end return module:send_iq(payload):next( function (result)