mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-09 23:40:27 +00:00
Fix webhooks for channels with special characters (xmpp) (#1405)
This commit is contained in:
parent
668e7407e6
commit
763bb95cea
@ -6,6 +6,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -157,7 +158,7 @@ func (b *Bxmpp) postSlackCompatibleWebhook(msg config.Message) error {
|
|||||||
return err
|
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 {
|
if err != nil {
|
||||||
b.Log.Errorf("Failed to POST webhook: %s", err)
|
b.Log.Errorf("Failed to POST webhook: %s", err)
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user