void HttpConnectionManagerConfig::processFilter(
    const envoy::extensions::filters::network::http_connection_manager::v3::HttpFilter&
        proto_config,
    int i, const std::string& prefix, const std::string& filter_chain_type,
    bool last_filter_in_current_config, FilterFactoriesList& filter_factories,
    DependencyManager& dependency_manager) {
  ENVOY_LOG(debug, "    {} filter #{}", prefix, i);
  if (proto_config.config_type_case() ==
      envoy::extensions::filters::network::http_connection_manager::v3::HttpFilter::ConfigTypeCase::
          kConfigDiscovery) {
    processDynamicFilterConfig(proto_config.name(), proto_config.config_discovery(),
                               filter_factories, filter_chain_type, last_filter_in_current_config);
    return;
  }

  // Now see if there is a factory that will accept the config.
  auto& factory =
      Config::Utility::getAndCheckFactory<Server::Configuration::NamedHttpFilterConfigFactory>(
          proto_config);
  ProtobufTypes::MessagePtr message = Config::Utility::translateToFactoryConfig(
      proto_config, context_.messageValidationVisitor(), factory);
  Http::FilterFactoryCb callback =
      factory.createFilterFactoryFromProto(*message, stats_prefix_, context_);
  dependency_manager.registerFilter(factory.name(), *factory.dependencies());
  bool is_terminal = factory.isTerminalFilterByProto(*message, context_);
  Config::Utility::validateTerminalFilters(proto_config.name(), factory.name(), filter_chain_type,
                                           is_terminal, last_filter_in_current_config);
  auto filter_config_provider = filter_config_provider_manager_.createStaticFilterConfigProvider(
      callback, proto_config.name());
  ENVOY_LOG(debug, "      name: {}", filter_config_provider->name());
  ENVOY_LOG(debug, "    config: {}",
            MessageUtil::getJsonStringFromMessageOrError(
                proto_config.has_typed_config()
                    ? static_cast<const Protobuf::Message&>(proto_config.typed_config())
                    : static_cast<const Protobuf::Message&>(
                          proto_config.hidden_envoy_deprecated_config()),
                true));
  filter_factories.push_back(std::move(filter_config_provider));
}
void HttpConnectionManagerConfig::processFilter(
    const envoy::extensions::filters::network::http_connection_manager::v3::HttpFilter&
        proto_config,
    int i, const std::string& prefix, const std::string& filter_chain_type,
    bool last_filter_in_current_config, FilterFactoriesList& filter_factories,
    DependencyManager& dependency_manager) {
  ENVOY_LOG(debug, "    {} filter #{}", prefix, i);
  if (proto_config.config_type_case() ==
      envoy::extensions::filters::network::http_connection_manager::v3::HttpFilter::ConfigTypeCase::
          kConfigDiscovery) {
    processDynamicFilterConfig(proto_config.name(), proto_config.config_discovery(),
                               filter_factories, filter_chain_type, last_filter_in_current_config);
    return;
  }

   
  auto& factory =
      Config::Utility::getAndCheckFactory<Server::Configuration::NamedHttpFilterConfigFactory>(
          proto_config);
  ProtobufTypes::MessagePtr message = Config::Utility::translateToFactoryConfig(
      proto_config, context_.messageValidationVisitor(), factory);
  Http::FilterFactoryCb callback =
      factory.createFilterFactoryFromProto(*message, stats_prefix_, context_);
  dependency_manager.registerFilter(factory.name(), *factory.dependencies());
  bool is_terminal = factory.isTerminalFilterByProto(*message, context_);
  Config::Utility::validateTerminalFilters(proto_config.name(), factory.name(), filter_chain_type,
                                           is_terminal, last_filter_in_current_config);
  auto filter_config_provider = filter_config_provider_manager_.createStaticFilterConfigProvider(
      callback, proto_config.name());
  ENVOY_LOG(debug, "      name: {}", filter_config_provider->name());
  ENVOY_LOG(debug, "    config: {}",
            MessageUtil::getJsonStringFromMessageOrError(
                proto_config.has_typed_config()
                    ? static_cast<const Protobuf::Message&>(proto_config.typed_config())
                    : static_cast<const Protobuf::Message&>(
                          proto_config.hidden_envoy_deprecated_config()),
                true));
  filter_factories.push_back(std::move(filter_config_provider));
}