mirror of
https://github.com/TwiN/gatus.git
synced 2026-02-15 05:05:05 +00:00
fix: Convert key to lowercase when looking up endpoint by key (#1150)
This commit is contained in:
@@ -106,7 +106,7 @@ type Config struct {
|
|||||||
func (config *Config) GetEndpointByKey(key string) *endpoint.Endpoint {
|
func (config *Config) GetEndpointByKey(key string) *endpoint.Endpoint {
|
||||||
for i := 0; i < len(config.Endpoints); i++ {
|
for i := 0; i < len(config.Endpoints); i++ {
|
||||||
ep := config.Endpoints[i]
|
ep := config.Endpoints[i]
|
||||||
if ep.Key() == key {
|
if ep.Key() == strings.ToLower(key) {
|
||||||
return ep
|
return ep
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ func (config *Config) GetEndpointByKey(key string) *endpoint.Endpoint {
|
|||||||
func (config *Config) GetExternalEndpointByKey(key string) *endpoint.ExternalEndpoint {
|
func (config *Config) GetExternalEndpointByKey(key string) *endpoint.ExternalEndpoint {
|
||||||
for i := 0; i < len(config.ExternalEndpoints); i++ {
|
for i := 0; i < len(config.ExternalEndpoints); i++ {
|
||||||
ee := config.ExternalEndpoints[i]
|
ee := config.ExternalEndpoints[i]
|
||||||
if ee.Key() == key {
|
if ee.Key() == strings.ToLower(key) {
|
||||||
return ee
|
return ee
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user