summaryrefslogtreecommitdiffstats
path: root/bridge/xmpp
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-09-07 21:36:25 +0200
committerGitHub <noreply@github.com>2019-09-07 21:36:25 +0200
commit3562d4220c7b2579990356085b0bec24c34392b2 (patch)
treebdd9780afdd001485ba8fec38306cef12e65229c /bridge/xmpp
parent1532f6e42798d1071c8a97423e838338bed7b570 (diff)
downloadmatterbridge-msglm-3562d4220c7b2579990356085b0bec24c34392b2.tar.gz
matterbridge-msglm-3562d4220c7b2579990356085b0bec24c34392b2.tar.bz2
matterbridge-msglm-3562d4220c7b2579990356085b0bec24c34392b2.zip
Bail if incorrect Jid (xmpp). Fixes #869 (#883)
Diffstat (limited to 'bridge/xmpp')
-rw-r--r--bridge/xmpp/xmpp.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go
index e950bcda..8f993a83 100644
--- a/bridge/xmpp/xmpp.go
+++ b/bridge/xmpp/xmpp.go
@@ -107,6 +107,9 @@ func (b *Bxmpp) Send(msg config.Message) (string, 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{
ServerName: strings.Split(b.GetString("Jid"), "@")[1],
InsecureSkipVerify: b.GetBool("SkipTLSVerify"), // nolint: gosec