syntax = "proto3";

package envoy.extensions.http.header_formatters.preserve_case.v3;

import "udpa/annotations/status.proto";
import "validate/validate.proto";

option java_package = "io.envoyproxy.envoy.extensions.http.header_formatters.preserve_case.v3";
option java_outer_classname = "PreserveCaseProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/http/header_formatters/preserve_case/v3;preserve_casev3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Preserve case header formatter]
// [#extension: envoy.http.stateful_header_formatters.preserve_case]

// Configuration for the preserve case header formatter.
// See the :ref:`header casing <config_http_conn_man_header_casing>` configuration guide for more
// information.
message PreserveCaseFormatterConfig {
  enum FormatterTypeOnEnvoyHeaders {
    // Use LowerCase on Envoy added headers.
    DEFAULT = 0;

    // Use ProperCaseHeaderKeyFormatter on Envoy added headers that upper cases the first character
    // in each word. The first character as well as any alpha character following a special
    // character is upper cased.
    PROPER_CASE = 1;
  }

  // Allows forwarding reason phrase text.
  // This is off by default, and a standard reason phrase is used for a corresponding HTTP response code.
  bool forward_reason_phrase = 1;

  // Type of formatter to use on headers which are added by Envoy (which are lower case by default).
  // The default type is DEFAULT, use LowerCase on Envoy headers.
  FormatterTypeOnEnvoyHeaders formatter_type_on_envoy_headers = 2
      [(validate.rules).enum = {defined_only: true}];
}
