1
#pragma once
2

            
3
#include "envoy/extensions/http/early_header_mutation/header_mutation/v3/header_mutation.pb.h"
4
#include "envoy/extensions/http/early_header_mutation/header_mutation/v3/header_mutation.pb.validate.h"
5
#include "envoy/http/early_header_mutation.h"
6

            
7
#include "source/common/http/header_mutation.h"
8

            
9
namespace Envoy {
10
namespace Extensions {
11
namespace Http {
12
namespace EarlyHeaderMutation {
13
namespace HeaderMutation {
14

            
15
using HeaderAppendAction = envoy::config::core::v3::HeaderValueOption::HeaderAppendAction;
16
using HeaderValueOption = envoy::config::core::v3::HeaderValueOption;
17
using ProtoHeaderMutation =
18
    envoy::extensions::http::early_header_mutation::header_mutation::v3::HeaderMutation;
19

            
20
class HeaderMutation : public Envoy::Http::EarlyHeaderMutation {
21
public:
22
  HeaderMutation(const ProtoHeaderMutation& mutations,
23
                 Server::Configuration::ServerFactoryContext& context);
24

            
25
  bool mutate(Envoy::Http::RequestHeaderMap& headers,
26
              const StreamInfo::StreamInfo& stream_info) const override;
27

            
28
private:
29
  std::unique_ptr<Envoy::Http::HeaderMutations> mutations_;
30
};
31

            
32
} // namespace HeaderMutation
33
} // namespace EarlyHeaderMutation
34
} // namespace Http
35
} // namespace Extensions
36
} // namespace Envoy