From: Evgeniy Khramtsov Date: Tue, 28 Feb 2017 21:17:27 +0000 (+0300) Subject: External components must always provide 'to' attribute X-Git-Tag: 17.03~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6e2840947a3965dfad878ef9745ff1dec52ebf5;p=ejabberd External components must always provide 'to' attribute --- diff --git a/src/xmpp_stream_in.erl b/src/xmpp_stream_in.erl index 7264b6d5a..c80fafe0e 100644 --- a/src/xmpp_stream_in.erl +++ b/src/xmpp_stream_in.erl @@ -458,8 +458,8 @@ process_stream(#stream_start{lang = Lang}, Txt = <<"Too long value of 'xml:lang' attribute">>, send_pkt(State, xmpp:serr_policy_violation(Txt, DefaultLang)); process_stream(#stream_start{to = undefined, version = Version} = StreamStart, - #{lang := Lang, server := Server} = State) -> - if Version < {1,0} -> + #{lang := Lang, server := Server, xmlns := NS} = State) -> + if Version < {1,0} andalso NS /= ?NS_COMPONENT -> %% Work-around for gmail servers To = jid:make(Server), process_stream(StreamStart#stream_start{to = To}, State);