Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kotkovkirill committed Oct 16, 2024
1 parent 2a5444e commit 8d50818
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/services/ngalert/notifier/channels/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@ func (sn *SlackNotifier) SendResolved() bool {
func (sn *SlackNotifier) minify(src []byte) string {
dst := &bytes.Buffer{}
if err := json.Compact(dst, []byte(src)); err != nil {
return strings.ReplaceAll(string(src), "\n", "")
r := strings.NewReplacer("\n", "","\"", " ")
return r.Replace(string(src))
}
return dst.String()

return strings.ReplaceAll(dst.String(), "\"", " ")
}

0 comments on commit 8d50818

Please sign in to comment.