From cce34cd52b5ff5e4a2169183e9f29c8584551d78 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 2 Mar 2020 11:54:06 -0800 Subject: [PATCH] xds: include port in VirtualHost domain matching --- src/core/ext/filters/client_channel/xds/xds_api.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/ext/filters/client_channel/xds/xds_api.cc b/src/core/ext/filters/client_channel/xds/xds_api.cc index 57565c02649..e2628cb3f57 100644 --- a/src/core/ext/filters/client_channel/xds/xds_api.cc +++ b/src/core/ext/filters/client_channel/xds/xds_api.cc @@ -451,9 +451,6 @@ MatchType DomainPatternMatchType(const std::string& domain_pattern) { grpc_error* RouteConfigParse( const envoy_api_v2_RouteConfiguration* route_config, const std::string& expected_server_name, XdsApi::RdsUpdate* rds_update) { - // Strip off port from server name, if any. - size_t pos = expected_server_name.find(':'); - std::string expected_host_name = expected_server_name.substr(0, pos); // Get the virtual hosts. size_t size; const envoy_api_v2_route_VirtualHost* const* virtual_hosts = @@ -490,7 +487,7 @@ grpc_error* RouteConfigParse( continue; } // Skip if match fails. - if (!DomainMatch(match_type, domain_pattern, expected_host_name)) { + if (!DomainMatch(match_type, domain_pattern, expected_server_name)) { continue; } // Choose this match.