Report problem when mod_rest receives malformed stanza (#65)

This commit is contained in:
Badlop 2015-04-15 13:37:09 +02:00
parent c098a763b0
commit fa47490da4
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ process(Path, Request) ->
%% Otherwise, it is considered an ejabberd command to execute.
maybe_post_request([$< | _ ] = Data, Host, ClientIp) ->
try
Stanza = xml_stream:parse_element(Data),
Stanza = {xmlel, _, _, _} = xml_stream:parse_element(Data),
From = jlib:string_to_jid(xml:get_tag_attr_s(<<"from">>, Stanza)),
To = jlib:string_to_jid(xml:get_tag_attr_s(<<"to">>, Stanza)),
allowed = check_stanza(Stanza, From, To, Host),