diff --git a/config/notifiers.go b/config/notifiers.go index 28aaa780..7b6f7197 100644 --- a/config/notifiers.go +++ b/config/notifiers.go @@ -15,6 +15,7 @@ package config import ( "fmt" + "net/textproto" "regexp" "strings" "time" @@ -22,8 +23,6 @@ import ( "github.com/pkg/errors" commoncfg "github.com/prometheus/common/config" "github.com/prometheus/common/sigv4" - "golang.org/x/text/cases" - "golang.org/x/text/language" ) var ( @@ -147,8 +146,6 @@ var ( Message: `{{ template "telegram.default.message" . }}`, ParseMode: "HTML", } - - normalizeTitle = cases.Title(language.AmericanEnglish) ) // NotifierConfig contains base options common across all notifier configurations. @@ -194,7 +191,7 @@ func (c *EmailConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { // Header names are case-insensitive, check for collisions. normalizedHeaders := map[string]string{} for h, v := range c.Headers { - normalized := normalizeTitle.String(h) + normalized := textproto.CanonicalMIMEHeaderKey(h) if _, ok := normalizedHeaders[normalized]; ok { return fmt.Errorf("duplicate header %q in email config", normalized) }