Trim root zone indicator from server address (#97)

This commit is contained in:
Geoff Bourne
2022-07-11 23:16:15 -05:00
committed by GitHub
parent 1a873cb58a
commit bc97b0ecbf
6 changed files with 29 additions and 595 deletions
+3 -1
View File
@@ -170,7 +170,9 @@ func (r *routesImpl) FindBackendForServerAddress(ctx context.Context, serverAddr
addressParts := strings.Split(serverAddress, "\x00")
address := strings.ToLower(addressParts[0])
address := strings.ToLower(
// trim the root zone indicator, see https://en.wikipedia.org/wiki/Fully_qualified_domain_name
strings.TrimSuffix(addressParts[0], "."))
if r.mappings != nil {
if mapping, exists := r.mappings[address]; exists {