diff --git a/CHANGELOG.md b/CHANGELOG.md index b587c12b0..69ee1e0c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Bugfixes +- [#1133](https://github.com/influxdata/kapacitor/issues/1133): Fix case-sensitivity for Telegram `parseMode` value. - [#1147](https://github.com/influxdata/kapacitor/issues/1147): Fix pprof debug endpoint - [#1164](https://github.com/influxdata/kapacitor/pull/1164): Fix hang in config API to update a config section. Now if the service update process takes too long the request will timeout and return an error. diff --git a/services/telegram/service.go b/services/telegram/service.go index f3028ec61..177399366 100644 --- a/services/telegram/service.go +++ b/services/telegram/service.go @@ -14,6 +14,7 @@ import ( "github.com/influxdata/kapacitor/alert" "github.com/pkg/errors" + "strings" ) type Service struct { @@ -143,7 +144,7 @@ func (s *Service) preparePost(chatId, parseMode, message string, disableWebPageP parseMode = c.ParseMode } - if parseMode != "" && parseMode != "Markdown" && parseMode != "HTML" { + if parseMode != "" && strings.ToLower(parseMode) != "markdown" && strings.ToLower(parseMode) != "html" { return "", nil, fmt.Errorf("parseMode %s is not valid, please use 'Markdown' or 'HTML'", parseMode) }