From 034b42dbe63357184e55480ad2868f5ac7bddebc Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Mon, 10 Jan 2022 19:53:27 +0000 Subject: [PATCH] grpc_http1_bridge: support for prepending and trimming the grpc frame header (#19331) This is an implementation based on the discussion in #19198. When application/x-protobuf is used the filter will prepend the payload with the gRPC header, as defined by the wire format. Before returning the response the frame is also trimmed. This functionality is behind a configuration setting. Risk Level: Medium Testing: Unit tests Docs Changes: Added Fixes #19198 Signed-off-by: Stefan Puhlmann Mirrored from https://github.com/envoyproxy/envoy @ 8feaee6e5801bdbe0837158e5fc499a723b1a108 --- .../filters/http/grpc_http1_bridge/v3/config.proto | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/envoy/extensions/filters/http/grpc_http1_bridge/v3/config.proto b/envoy/extensions/filters/http/grpc_http1_bridge/v3/config.proto index 14685316..8bfe85b2 100644 --- a/envoy/extensions/filters/http/grpc_http1_bridge/v3/config.proto +++ b/envoy/extensions/filters/http/grpc_http1_bridge/v3/config.proto @@ -19,4 +19,11 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; message Config { option (udpa.annotations.versioning).previous_message_type = "envoy.config.filter.http.grpc_http1_bridge.v2.Config"; + + // If true then requests with content type set to `application/x-protobuf` will be automatically converted to gRPC. + // This works by prepending the payload data with the gRPC header frame, as defined by the wiring format, and + // Content-Type will be updated accordingly before sending the request. + // For the requests that went through this upgrade the filter will also strip the frame before forwarding the + // response to the client. + bool upgrade_protobuf_to_grpc = 1; }