5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 17:30:26 +00:00

Bail if incorrect Jid (xmpp). Fixes #869 (#883)

This commit is contained in:
Wim 2019-09-07 21:36:25 +02:00 committed by GitHub
parent 1532f6e427
commit 3562d4220c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,6 +107,9 @@ func (b *Bxmpp) Send(msg config.Message) (string, error) {
} }
func (b *Bxmpp) createXMPP() error { func (b *Bxmpp) createXMPP() error {
if !strings.Contains(b.GetString("Jid"), "@") {
return fmt.Errorf("the Jid %s doesn't contain an @", b.GetString("Jid"))
}
tc := &tls.Config{ tc := &tls.Config{
ServerName: strings.Split(b.GetString("Jid"), "@")[1], ServerName: strings.Split(b.GetString("Jid"), "@")[1],
InsecureSkipVerify: b.GetBool("SkipTLSVerify"), // nolint: gosec InsecureSkipVerify: b.GetBool("SkipTLSVerify"), // nolint: gosec