Skip to content

Commit 7c27fcb

Browse files
authored
fix: Convert key to lowercase when looking up endpoint by key (#1150)
1 parent 3db5894 commit 7c27fcb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

config/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ type Config struct {
106106
func (config *Config) GetEndpointByKey(key string) *endpoint.Endpoint {
107107
for i := 0; i < len(config.Endpoints); i++ {
108108
ep := config.Endpoints[i]
109-
if ep.Key() == key {
109+
if ep.Key() == strings.ToLower(key) {
110110
return ep
111111
}
112112
}
@@ -116,7 +116,7 @@ func (config *Config) GetEndpointByKey(key string) *endpoint.Endpoint {
116116
func (config *Config) GetExternalEndpointByKey(key string) *endpoint.ExternalEndpoint {
117117
for i := 0; i < len(config.ExternalEndpoints); i++ {
118118
ee := config.ExternalEndpoints[i]
119-
if ee.Key() == key {
119+
if ee.Key() == strings.ToLower(key) {
120120
return ee
121121
}
122122
}
@@ -411,8 +411,8 @@ func validateAlertingConfig(alertingConfig *alerting.Config, endpoints []*endpoi
411411
alert.TypeGitea,
412412
alert.TypeGoogleChat,
413413
alert.TypeGotify,
414-
alert.TypeHomeAssistant,
415-
alert.TypeIlert,
414+
alert.TypeHomeAssistant,
415+
alert.TypeIlert,
416416
alert.TypeIncidentIO,
417417
alert.TypeJetBrainsSpace,
418418
alert.TypeMatrix,

0 commit comments

Comments
 (0)