summaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorAlexander <papatutuwawa@polynom.me>2021-02-17 21:30:06 +0100
committerGitHub <noreply@github.com>2021-02-17 21:30:06 +0100
commit763bb95ceadde6aa51ee72ff8a40407909823024 (patch)
tree31cadc6d00b87a9aaf2dcd54a2708c6b09f25c3b /bridge
parent668e7407e697d33751d24b84dfb98e23dd1ea260 (diff)
downloadmatterbridge-msglm-763bb95ceadde6aa51ee72ff8a40407909823024.tar.gz
matterbridge-msglm-763bb95ceadde6aa51ee72ff8a40407909823024.tar.bz2
matterbridge-msglm-763bb95ceadde6aa51ee72ff8a40407909823024.zip
Fix webhooks for channels with special characters (xmpp) (#1405)
Diffstat (limited to 'bridge')
-rw-r--r--bridge/xmpp/xmpp.go3
1 files changed, 2 insertions, 1 deletions
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