diff options
author | Kim Alvefur <zash@zash.se> | 2016-11-26 20:11:03 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-11-26 20:11:03 +0100 |
commit | 728d74d8bf721e7f9377bcdeea7e456f15d0e856 (patch) | |
tree | 5fafe37e76936f880749432bffa3174a7ca120cd /core/stanza_router.lua | |
parent | c8bbcabaf7597f13bace9e5aefc98ecb9e172796 (diff) | |
parent | 1b95aabe8959649223e49482b31eea221844d7a3 (diff) | |
download | prosody-728d74d8bf721e7f9377bcdeea7e456f15d0e856.tar.gz prosody-728d74d8bf721e7f9377bcdeea7e456f15d0e856.zip |
Merge 0.10->trunk
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r-- | core/stanza_router.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua index cf098258..af797f08 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -67,8 +67,14 @@ function core_process_stanza(origin, stanza) return handle_unhandled_stanza(origin.host, origin, stanza); end if name == "iq" then - if not iq_types[st_type] or ((st_type == "set" or st_type == "get") and (#stanza.tags ~= 1)) then - origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid IQ type or incorrect number of children")); + if not iq_types[st_type] then + origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid IQ type")); + return; + elseif not stanza.attr.id then + origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing required 'id' attribute")); + return; + elseif (st_type == "set" or st_type == "get") and (#stanza.tags ~= 1) then + origin.send(st.error_reply(stanza, "modify", "bad-request", "Incorrect number of children for IQ stanz")); return; end end |