Software /
code /
prosody
Comparison
core/stanza_router.lua @ 1152:4d95e8078405
stanza_router: Fixed an invalid stanza check
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 15 May 2009 07:04:41 +0500 |
parent | 1149:72fc323050c1 |
child | 1156:14f3eb0e7787 |
comparison
equal
deleted
inserted
replaced
1151:8096941b6734 | 1152:4d95e8078405 |
---|---|
52 function core_process_stanza(origin, stanza) | 52 function core_process_stanza(origin, stanza) |
53 (origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:top_tag()) | 53 (origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:top_tag()) |
54 | 54 |
55 if not stanza.attr.xmlns then stanza.attr.xmlns = "jabber:client"; end -- FIXME Hack. This should be removed when we fix namespace handling. | 55 if not stanza.attr.xmlns then stanza.attr.xmlns = "jabber:client"; end -- FIXME Hack. This should be removed when we fix namespace handling. |
56 -- TODO verify validity of stanza (as well as JID validity) | 56 -- TODO verify validity of stanza (as well as JID validity) |
57 if stanza.attr.xmlns == "error" and #stanza.tags == 0 then return; end -- TODO invalid stanza, log | 57 if stanza.attr.type == "error" and #stanza.tags == 0 then return; end -- TODO invalid stanza, log |
58 if stanza.name == "iq" then | 58 if stanza.name == "iq" then |
59 if (stanza.attr.type == "set" or stanza.attr.type == "get") and #stanza.tags ~= 1 then | 59 if (stanza.attr.type == "set" or stanza.attr.type == "get") and #stanza.tags ~= 1 then |
60 origin.send(st.error_reply(stanza, "modify", "bad-request")); | 60 origin.send(st.error_reply(stanza, "modify", "bad-request")); |
61 return; | 61 return; |
62 end | 62 end |