summaryrefslogtreecommitdiff
path: root/src/ejabberd_bosh.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/ejabberd_bosh.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/ejabberd_bosh.erl')
-rw-r--r--src/ejabberd_bosh.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ejabberd_bosh.erl b/src/ejabberd_bosh.erl
index 4a552f43..1ec45a3e 100644
--- a/src/ejabberd_bosh.erl
+++ b/src/ejabberd_bosh.erl
@@ -739,9 +739,10 @@ bounce_receivers(State, Reason) ->
State, Receivers ++ ShapedReceivers).
bounce_els_from_obuf(State) ->
+ Opts = ejabberd_config:codec_options(State#state.host),
p1_queue:foreach(
fun({xmlstreamelement, El}) ->
- try xmpp:decode(El, ?NS_CLIENT, [ignore_els]) of
+ try xmpp:decode(El, ?NS_CLIENT, Opts) of
Pkt when ?is_stanza(Pkt) ->
case {xmpp:get_from(Pkt), xmpp:get_to(Pkt)} of
{#jid{}, #jid{}} ->