From 763bb95ceadde6aa51ee72ff8a40407909823024 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 17 Feb 2021 21:30:06 +0100 Subject: Fix webhooks for channels with special characters (xmpp) (#1405) --- bridge/xmpp/xmpp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bridge/xmpp/xmpp.go') diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go index b471326b..89a48742 100644 --- a/bridge/xmpp/xmpp.go +++ b/bridge/xmpp/xmpp.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "net/http" + "net/url" "strings" "sync" "time" @@ -157,7 +158,7 @@ func (b *Bxmpp) postSlackCompatibleWebhook(msg config.Message) error { return err } - resp, err := http.Post(b.GetString("WebhookURL")+"/"+msg.Channel, "application/json", bytes.NewReader(webhookBody)) + resp, err := http.Post(b.GetString("WebhookURL")+"/"+url.QueryEscape(msg.Channel), "application/json", bytes.NewReader(webhookBody)) if err != nil { b.Log.Errorf("Failed to POST webhook: %s", err) return err -- cgit v1.2.3