grpc_json: support unescape '+' in query parameters to space. (#18226)

To fix: #13965

grpc_json envoy filter adds a new field 'query_param_unescape_plus` to enable the support of converting "+" to space in query parameters.

The actual unescape code is implemented in grpc-httpjson-transcoding.

Risk Level: None
Testing: integration tests
Docs Changes: None
Release Notes: Yes

Signed-off-by: Wayne Zhang <qiwzhang@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 1ba355b5e9f00cda595d5b52e3390d473fa5ecce
pull/624/head
data-plane-api(Azure Pipelines) 3 years ago
parent 0ba1805d60
commit 533b32f1b3
  1. 8
      envoy/config/route/v3/route_components.proto
  2. 8
      envoy/extensions/filters/http/grpc_json_transcoder/v3/transcoder.proto

@ -529,6 +529,14 @@ message RouteMatch {
// against all the specified query parameters. If the number of specified
// query parameters is nonzero, they all must match the *path* header's
// query string for a match to occur.
//
// .. note::
//
// If query parameters are used to pass request message fields when
// `grpc_json_transcoder <https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_json_transcoder_filter>`_
// is used, the transcoded message fields maybe different. The query parameters are
// url encoded, but the message fields are not. For example, if a query
// parameter is "foo%20bar", the message field will be "foo bar".
repeated QueryParameterMatcher query_parameters = 7;
// If specified, only gRPC requests will be matched. The router will check

@ -15,7 +15,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// gRPC-JSON transcoder :ref:`configuration overview <config_http_filters_grpc_json_transcoder>`.
// [#extension: envoy.filters.http.grpc_json_transcoder]
// [#next-free-field: 12]
// [#next-free-field: 13]
// GrpcJsonTranscoder filter configuration.
// The filter itself can be used per route / per virtual host or on the general level. The most
// specific one is being used for a given route. If the list of services is empty - filter
@ -211,12 +211,16 @@ message GrpcJsonTranscoder {
bool convert_grpc_status = 9;
// URL unescaping policy.
// This spec is only applied when extracting variable with multiple segments.
// This spec is only applied when extracting variable with multiple segments in the URL path.
// For example, in case of `/foo/{x=*}/bar/{y=prefix/*}/{z=**}` `x` variable is single segment and `y` and `z` are multiple segments.
// For a path with `/foo/first/bar/prefix/second/third/fourth`, `x=first`, `y=prefix/second`, `z=third/fourth`.
// If this setting is not specified, the value defaults to :ref:`ALL_CHARACTERS_EXCEPT_RESERVED<envoy_v3_api_enum_value_extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder.UrlUnescapeSpec.ALL_CHARACTERS_EXCEPT_RESERVED>`.
UrlUnescapeSpec url_unescape_spec = 10 [(validate.rules).enum = {defined_only: true}];
// If true, unescape '+' to space when extracting variables in query parameters.
// This is to support `HTML 2.0 <https://tools.ietf.org/html/rfc1866#section-8.2.1>`_
bool query_param_unescape_plus = 12;
// Configure the behavior when handling requests that cannot be transcoded.
//
// By default, the transcoder will silently pass through HTTP requests that are malformed.

Loading…
Cancel
Save