Repository: envoyproxy/envoy
File: api/envoy/config/route/v3/route_components.proto (Protocol Buffers)

Code before:
    ];

    // If not specified, all requests to the target cluster will be mirrored.
    //
    // If specified, this field takes precedence over the ``runtime_key`` field and requests must also
    // fall under the percentage of matches indicated by this field.
    //
    // For some fraction N/D, a random number in the range [0,D) is selected. If the
    // number is <= the value of the numerator N, or if the key is not present, the default
    // value, the request will be mirrored.
    core.v3.RuntimeFractionalPercent runtime_fraction = 3;

    // Specifies whether the trace span for the shadow request should be sampled. If this field is not explicitly set,
    // the shadow request will inherit the sampling decision of its parent span. This ensures consistency with the trace
    // sampling policy of the original request and prevents oversampling, especially in scenarios where runtime sampling
    // is disabled.
    google.protobuf.BoolValue trace_sampled = 4;

    // Disables appending the ``-shadow`` suffix to the shadowed ``Host`` header. Defaults to ``false``.
    bool disable_shadow_host_suffix_append = 6;

    // Specifies a list of header mutations that should be applied to each mirrored request.
    // Header mutations are applied in the order they are specified. For more information, including
    // details on header value syntax, see the documentation on :ref:`custom request headers
    // <config_http_conn_man_headers_custom_request_headers>`.
    repeated common.mutation_rules.v3.HeaderMutation request_header_mutations = 7
        [(validate.rules).repeated = {max_items: 1000}];

    // Indicates that during mirroring, the host header will be swapped with this value.
    // :ref:`disable_shadow_host_suffix_append
    // <envoy_v3_api_field_config.route.v3.RouteAction.RequestMirrorPolicy.disable_shadow_host_suffix_append>`
    // is implicitly enabled if this field is set.
    string host_rewrite_literal = 8
        [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
  }

  // Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer
  // <arch_overview_load_balancing_types>`.
  // [#next-free-field: 7]
  message HashPolicy {
    option (udpa.annotations.versioning).previous_message_type =
        "envoy.api.v2.route.RouteAction.HashPolicy";

    message Header {
      option (udpa.annotations.versioning).previous_message_type =
          "envoy.api.v2.route.RouteAction.HashPolicy.Header";

      // The name of the request header that will be used to obtain the hash
      // key. If the request header is not present, no hash will be produced.
      string header_name = 1
          [(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];

Review comment (suggestion):
```suggestion
    repeated common.mutation_rules.v3.HeaderMutation request_headers_mutations = 7
```

We used `request_headers_to_add`, `request_trailers_mutations` and so on at other positions. So, use `request_headers_mutations` would be better to keep consistence.

Code after:
    ];

    // If not specified, all requests to the target cluster will be mirrored.
    //
    // If specified, this field takes precedence over the ``runtime_key`` field and requests must also
    // fall under the percentage of matches indicated by this field.
    //
    // For some fraction N/D, a random number in the range [0,D) is selected. If the
    // number is <= the value of the numerator N, or if the key is not present, the default
    // value, the request will be mirrored.
    core.v3.RuntimeFractionalPercent runtime_fraction = 3;

    // Specifies whether the trace span for the shadow request should be sampled. If this field is not explicitly set,
    // the shadow request will inherit the sampling decision of its parent span. This ensures consistency with the trace
    // sampling policy of the original request and prevents oversampling, especially in scenarios where runtime sampling
    // is disabled.
    google.protobuf.BoolValue trace_sampled = 4;

    // Disables appending the ``-shadow`` suffix to the shadowed ``Host`` header. Defaults to ``false``.
    bool disable_shadow_host_suffix_append = 6;

    // Specifies a list of header mutations that should be applied to each mirrored request.
    // Header mutations are applied in the order they are specified. For more information, including
    // details on header value syntax, see the documentation on :ref:`custom request headers
    // <config_http_conn_man_headers_custom_request_headers>`.
    repeated common.mutation_rules.v3.HeaderMutation request_headers_mutations = 7
        [(validate.rules).repeated = {max_items: 1000}];

    // Indicates that during mirroring, the host header will be swapped with this value.
    // :ref:`disable_shadow_host_suffix_append
    // <envoy_v3_api_field_config.route.v3.RouteAction.RequestMirrorPolicy.disable_shadow_host_suffix_append>`
    // is implicitly enabled if this field is set.
    string host_rewrite_literal = 8
        [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
  }

  // Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer
  // <arch_overview_load_balancing_types>`.
  // [#next-free-field: 7]
  message HashPolicy {
    option (udpa.annotations.versioning).previous_message_type =
        "envoy.api.v2.route.RouteAction.HashPolicy";

    message Header {
      option (udpa.annotations.versioning).previous_message_type =
          "envoy.api.v2.route.RouteAction.HashPolicy.Header";

      // The name of the request header that will be used to obtain the hash
      // key. If the request header is not present, no hash will be produced.
      string header_name = 1
          [(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME strict: false}];