Browse Source

fix validation of notifcation by sender/from address

Reviewed-on: https://dev.sum7.eu/genofire/unified-push-xmpp/pulls/19
main
genofire 2 months ago
parent
commit
612d577b21
  1. 2
      distributor/xmpp.go

2
distributor/xmpp.go

@ -113,7 +113,7 @@ func (s *XMPPService) message(msgHead stanza.Message, t xmlstream.TokenReadEncod
return nil
}
from := msgHead.From.String()
if settings := strings.Split(conn.Settings, ":"); len(settings) > 1 && settings[0] == from {
if settings := strings.Split(conn.Settings, ":"); !(len(settings) > 1 && settings[0] == from) {
log.WithField("from", from).Info("message not from gateway, that is no notification")
return nil
}

Loading…
Cancel
Save