]> granicus.if.org Git - ejabberd/commitdiff
External components must always provide 'to' attribute
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Tue, 28 Feb 2017 21:17:27 +0000 (00:17 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Tue, 28 Feb 2017 21:17:27 +0000 (00:17 +0300)
src/xmpp_stream_in.erl

index 7264b6d5a8c22e88f10cb84091e714099ea4379b..c80fafe0ea7c53fd200439a2cf9704573127995b 100644 (file)
@@ -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);