Skip to content

Commit

Permalink
Replace html/template with text/template
Browse files Browse the repository at this point in the history
The the html/template package escapes certain special characters such as
`"`.  If the messages received from Alertmanager contain these special
characters they will show up HTML-encoded in the chat message.

    summary: Server "foo" is down

instead of:

    summary: Server "foo" is down

This patch relaces html/template with text/template because there's no
need for special HTML escape rules to generate a notification message.

Resolves #7

Signed-off-by: David Wagner <david.wagner@pix4d.com>
  • Loading branch information
David Wagner committed Dec 3, 2019
1 parent 6eabd82 commit 5d3b702
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"bytes"
"html/template"
"strings"
"text/template"

alerttemplate "github.com/prometheus/alertmanager/template"
"github.com/spf13/viper"
Expand Down

0 comments on commit 5d3b702

Please sign in to comment.