Line data Source code
1 : #include "source/extensions/http/early_header_mutation/header_mutation/config.h" 2 : 3 : #include "source/common/config/utility.h" 4 : 5 : namespace Envoy { 6 : namespace Extensions { 7 : namespace Http { 8 : namespace EarlyHeaderMutation { 9 : namespace HeaderMutation { 10 : 11 : Envoy::Http::EarlyHeaderMutationPtr 12 : Factory::createExtension(const Protobuf::Message& message, 13 0 : Server::Configuration::FactoryContext& context) { 14 0 : auto mptr = Envoy::Config::Utility::translateAnyToFactoryConfig( 15 0 : dynamic_cast<const ProtobufWkt::Any&>(message), context.messageValidationVisitor(), *this); 16 0 : const auto& proto_config = MessageUtil::downcastAndValidate< 17 0 : const envoy::extensions::http::early_header_mutation::header_mutation::v3::HeaderMutation&>( 18 0 : *mptr, context.messageValidationVisitor()); 19 0 : return std::make_unique<HeaderMutation>(proto_config); 20 0 : } 21 : 22 : REGISTER_FACTORY(Factory, Envoy::Http::EarlyHeaderMutationFactory); 23 : 24 : } // namespace HeaderMutation 25 : } // namespace EarlyHeaderMutation 26 : } // namespace Http 27 : } // namespace Extensions 28 : } // namespace Envoy