Skip to content

Commit

Permalink
Merged pull request #1168 from Appeltabak/1133-telegram-parsemode-opt…
Browse files Browse the repository at this point in the history
…ion-markdown-should-be-case-insensitive

Fix case-sensitivity of Telegram parse mode values.
  • Loading branch information
nathanielc committed Feb 13, 2017
2 parents 214eaba + 9396113 commit d9f8ac4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion services/telegram/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/influxdata/kapacitor/alert"
"github.com/pkg/errors"
"strings"
)

type Service struct {
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit d9f8ac4

Please sign in to comment.