Browse Source

Change strview.data() to string(strview) (porting to v1.31.x)

Donna Dionne 4 years ago
parent
commit
d1f34093a9
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc

+ 3 - 2
src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc

@@ -232,7 +232,7 @@ bool PathMatch(
       return path == path_matcher.string_matcher;
     case XdsApi::RdsUpdate::RdsRoute::Matchers::PathMatcher::PathMatcherType::
         REGEX:
-      return RE2::FullMatch(path.data(), *path_matcher.regex_matcher);
+      return RE2::FullMatch(std::string(path), *path_matcher.regex_matcher);
     default:
       return false;
   }
@@ -292,7 +292,8 @@ bool HeaderMatchHelper(
       return value.value() == header_matcher.string_matcher;
     case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
         HeaderMatcherType::REGEX:
-      return RE2::FullMatch(value.value().data(), *header_matcher.regex_match);
+      return RE2::FullMatch(std::string(value.value()),
+                            *header_matcher.regex_match);
     case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
         HeaderMatcherType::RANGE:
       int64_t int_value;