bool StringSanMatcher::match(const GENERAL_NAME* general_name) const {
  if (general_name->type != general_name_type_) {
    return false;
  }
  // For DNS SAN, if the StringMatcher type is exact, we have to follow DNS matching semantics.
  const std::string san = Utility::generalNameAsString(general_name);
  return general_name->type == GEN_DNS &&
                 matcher_.matcher().match_pattern_case() ==
                     envoy::type::matcher::v3::StringMatcher::MatchPatternCase::kExact
             ? Utility::dnsNameMatch(matcher_.matcher().exact(), absl::string_view(san))
             : matcher_.match(san);
}
bool StringSanMatcher::match(const GENERAL_NAME* general_name) const {
  if (general_name->type != general_name_type_) {
    return false;
  }
   
  const std::string san = Utility::generalNameAsString(general_name);
  return general_name->type == GEN_DNS &&
                 matcher_.matcher().match_pattern_case() ==
                     envoy::type::matcher::v3::StringMatcher::MatchPatternCase::kExact
             ? Utility::dnsNameMatch(matcher_.matcher().exact(), absl::string_view(san))
             : matcher_.match(san);
}