summaryrefslogtreecommitdiff
path: root/src/mod_delegation.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2018-02-09 18:12:50 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2018-02-09 18:12:50 +0300
commit672c2f75d3ebd659c514b0ce1ecc70ecaa99f31f (patch)
tree92111588ed1c5d5877dac12d348652cb87b44f6c /src/mod_delegation.erl
parentFix type spec (diff)
Introduce option 'validate_stream'
If set to `true`, all incoming XML packets are fully validated against known schemas. If an error occurs, the packet will be bounced with the corresponding error reason. The default value is `false`. The option might be useful to protect client software from sofisticated bugs related to XML validation as well as for client developers who want to catch validation errors at early stage of development. Note that the option might have slight performance impact, so use it with care on loaded machines.
Diffstat (limited to 'src/mod_delegation.erl')
-rw-r--r--src/mod_delegation.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mod_delegation.erl b/src/mod_delegation.erl
index 350a2db3..9822e81f 100644
--- a/src/mod_delegation.erl
+++ b/src/mod_delegation.erl
@@ -261,9 +261,10 @@ process_iq(#iq{to = To, lang = Lang, sub_els = [SubEl]} = IQ, Type) ->
process_iq_result(#iq{from = From, to = To, id = ID, lang = Lang} = IQ,
#iq{type = result} = ResIQ) ->
try
+ CodecOpts = ejabberd_config:codec_options(To#jid.lserver),
#delegation{forwarded = #forwarded{sub_els = [SubEl]}} =
xmpp:get_subtag(ResIQ, #delegation{}),
- case xmpp:decode(SubEl, ?NS_CLIENT, [ignore_els]) of
+ case xmpp:decode(SubEl, ?NS_CLIENT, CodecOpts) of
#iq{from = To, to = From, type = Type, id = ID} = Reply
when Type == error; Type == result ->
ejabberd_router:route(Reply)