diff --git a/server/routes.go b/server/routes.go index ded52f3..e634de4 100644 --- a/server/routes.go +++ b/server/routes.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "net/http" + "regexp" "strings" "sync" @@ -11,6 +12,8 @@ import ( "github.com/sirupsen/logrus" ) +var tcpShieldPattern = regexp.MustCompile("///.*") + func init() { apiRoutes.Path("/routes").Methods("GET"). Headers("Accept", "application/json"). @@ -177,6 +180,9 @@ func (r *routesImpl) FindBackendForServerAddress(ctx context.Context, serverAddr // trim the root zone indicator, see https://en.wikipedia.org/wiki/Fully_qualified_domain_name strings.TrimSuffix(addressParts[0], ".")) + // Strip suffix of TCP Shield + address = tcpShieldPattern.ReplaceAllString(address, "") + if r.mappings != nil { if mapping, exists := r.mappings[address]; exists { return mapping.backend, address, mapping.waker