fix: prioritize longer and more explicit host names

This commit is contained in:
Simone Margaritelli 2024-09-22 15:21:11 +02:00
parent 5969acd55d
commit fabf3bb8e9

View file

@ -203,7 +203,8 @@ func (t *Endpoint) OnMeta(meta map[string]string) {
t.Meta.Set(k, v)
}
if t.Hostname == "" {
// prioritize longer and more explicit host names
if len(host) > len(t.Hostname) {
t.Hostname = host
}
}