Merge pull request #22204 from markdroth/xds_virtual_domain_matching_fix

xds: include port in VirtualHost domain matching
pull/22228/head
Mark D. Roth 5 years ago committed by GitHub
commit 08a42364a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      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.

Loading…
Cancel
Save