Mercurial > prosody-modules
comparison mod_firewall/actions.lib.lua @ 2094:a1e9ca4cb181
mod_firewall: BOUNCE: Don't bounce error stanzas or iq results
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 16 Mar 2016 12:42:17 +0000 |
parents | de6b95d5e01b |
children | f2ee508315e1 |
comparison
equal
deleted
inserted
replaced
2093:7b9520479e99 | 2094:a1e9ca4cb181 |
---|---|
140 if text then | 140 if text then |
141 text = string.format("%q", text); | 141 text = string.format("%q", text); |
142 else | 142 else |
143 text = "nil"; | 143 text = "nil"; |
144 end | 144 end |
145 return route_modify(("error_reply(stanza, %s, %s, %s)"):format(error_type, error, text), nil, true); | 145 local route_modify_code, deps = route_modify(("error_reply(stanza, %s, %s, %s)"):format(error_type, error, text), nil, true); |
146 deps[#deps+1] = "type"; | |
147 deps[#deps+1] = "name"; | |
148 return [[if type == "error" or (name == "iq" and type == "result") then return true; end -- Don't reply to 'error' stanzas, or iq results | |
149 ]]..route_modify_code, deps; | |
146 end | 150 end |
147 | 151 |
148 function action_handlers.REDIRECT(where) | 152 function action_handlers.REDIRECT(where) |
149 return route_modify("clone(stanza)", where, true); | 153 return route_modify("clone(stanza)", where, true); |
150 end | 154 end |