Fix ext_proc filter can not send non-utf8 character by gRPC (#27865)

* Fix ext_proc filter can not send non-utf8 character by gRPC

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 9c6e75062ebdd8c8382c671662fb096569d9eaa9
main
update-envoy[bot] 1 year ago
parent 5ffb743033
commit 93641a69c3
  1. 12
      envoy/config/core/v3/base.proto
  2. 24
      envoy/service/ext_proc/v3/external_processor.proto

@ -324,8 +324,18 @@ message HeaderValue {
// The same :ref:`format specifier <config_access_log_format>` as used for
// :ref:`HTTP access logging <config_access_log>` applies here, however
// unknown header values are replaced with the empty string instead of ``-``.
// Header value is encoded as string. This does not work for non-utf8 characters.
// Only one of ``value`` or ``value_bytes`` can be set.
string value = 2 [
(validate.rules).string = {max_bytes: 16384 well_known_regex: HTTP_HEADER_VALUE strict: false}
(validate.rules).string = {max_bytes: 16384 well_known_regex: HTTP_HEADER_VALUE strict: false},
(udpa.annotations.field_migrate).oneof_promotion = "value_type"
];
// Header value is encoded as bytes which can support non-utf8 characters.
// Only one of ``value`` or ``value_bytes`` can be set.
bytes value_bytes = 3 [
(validate.rules).bytes = {min_len: 0 max_len: 16384},
(udpa.annotations.field_migrate).oneof_promotion = "value_type"
];
}

@ -199,6 +199,12 @@ message ProcessingResponse {
message HttpHeaders {
// The HTTP request headers. All header keys will be
// lower-cased, because HTTP header keys are case-insensitive.
// The ``headers`` encoding is based on the runtime guard
// envoy_reloadable_features_send_header_value_in_bytes setting.
// When it is true, the header value is encoded in the
// :ref:`value_bytes <envoy_v3_api_field_config.core.v3.HeaderValue.value_bytes>` field.
// When it is false, the header value is encoded in the
// :ref:`value <envoy_v3_api_field_config.core.v3.HeaderValue.value>` field.
config.core.v3.HeaderMap headers = 1;
// [#not-implemented-hide:]
@ -223,6 +229,12 @@ message HttpBody {
// This message contains the trailers.
message HttpTrailers {
// The ``trailers`` encoding is based on the runtime guard
// envoy_reloadable_features_send_header_value_in_bytes setting.
// When it is true, the header value is encoded in the
// :ref:`value_bytes <envoy_v3_api_field_config.core.v3.HeaderValue.value_bytes>` field.
// When it is false, the header value is encoded in the
// :ref:`value <envoy_v3_api_field_config.core.v3.HeaderValue.value>` field.
config.core.v3.HeaderMap trailers = 1;
}
@ -290,6 +302,12 @@ message CommonResponse {
// Add new trailers to the message. This may be used when responding to either a
// HttpHeaders or HttpBody message, but only if this message is returned
// along with the CONTINUE_AND_REPLACE status.
// The ``trailers`` encoding is based on the runtime guard
// envoy_reloadable_features_send_header_value_in_bytes setting.
// When it is true, the header value is encoded in the
// :ref:`value_bytes <envoy_v3_api_field_config.core.v3.HeaderValue.value_bytes>` field.
// When it is false, the header value is encoded in the
// :ref:`value <envoy_v3_api_field_config.core.v3.HeaderValue.value>` field.
config.core.v3.HeaderMap trailers = 4;
// Clear the route cache for the current client request. This is necessary
@ -337,6 +355,12 @@ message HeaderMutation {
// Add or replace HTTP headers. Attempts to set the value of
// any ``x-envoy`` header, and attempts to set the ``:method``,
// ``:authority``, ``:scheme``, or ``host`` headers will be ignored.
// The ``set_headers`` encoding is based on the runtime guard
// envoy_reloadable_features_send_header_value_in_bytes setting.
// When it is true, the header value is encoded in the
// :ref:`value_bytes <envoy_v3_api_field_config.core.v3.HeaderValue.value_bytes>` field.
// When it is false, the header value is encoded in the
// :ref:`value <envoy_v3_api_field_config.core.v3.HeaderValue.value>` field.
repeated config.core.v3.HeaderValueOption set_headers = 1;
// Remove these HTTP headers. Attempts to remove system headers --

Loading…
Cancel
Save