From 050acf74a4529e62b273ffac4b2f6339afb81022 Mon Sep 17 00:00:00 2001 From: Sarah Brofeldt Date: Mon, 23 May 2022 10:21:10 +0200 Subject: [PATCH] Trim contents of slack api urls from files --- notify/slack/slack.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notify/slack/slack.go b/notify/slack/slack.go index c719c0d42b..b2b25c87e7 100644 --- a/notify/slack/slack.go +++ b/notify/slack/slack.go @@ -20,6 +20,7 @@ import ( "fmt" "io/ioutil" "net/http" + "strings" "github.com/go-kit/log" "github.com/go-kit/log/level" @@ -194,7 +195,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error) if err != nil { return false, err } - u = string(content) + u = strings.TrimSpace(string(content)) } resp, err := notify.PostJSON(ctx, n.client, u, &buf)