ratelimit add support for custom http response code (#20520)

Signed-off-by: xiada <maxxd@qq.com>

Mirrored from https://github.com/envoyproxy/envoy @ 6c297a788b236309ebc329f29ebe534238ee24cd
pull/626/head
data-plane-api(Azure Pipelines) 3 years ago
parent d53106f0b3
commit 248590819a
  1. 1
      envoy/extensions/filters/http/ratelimit/v3/BUILD
  2. 11
      envoy/extensions/filters/http/ratelimit/v3/rate_limit.proto

@ -10,6 +10,7 @@ api_proto_package(
"//envoy/config/ratelimit/v3:pkg",
"//envoy/config/route/v3:pkg",
"//envoy/type/metadata/v3:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)

@ -6,6 +6,7 @@ import "envoy/config/core/v3/extension.proto";
import "envoy/config/ratelimit/v3/rls.proto";
import "envoy/config/route/v3/route_components.proto";
import "envoy/type/metadata/v3/metadata.proto";
import "envoy/type/v3/http_status.proto";
import "google/protobuf/duration.proto";
@ -23,7 +24,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// Rate limit :ref:`configuration overview <config_http_filters_rate_limit>`.
// [#extension: envoy.filters.http.ratelimit]
// [#next-free-field: 10]
// [#next-free-field: 11]
message RateLimit {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.http.rate_limit.v2.RateLimit";
@ -111,6 +112,14 @@ message RateLimit {
// in case of rate limiting (i.e. 429 responses).
// Having this header not present potentially makes the request retriable.
bool disable_x_envoy_ratelimited_header = 9;
// This field allows for a custom HTTP response status code to the downstream client when
// the request has been rate limited.
// Defaults to 429 (TooManyRequests).
//
// .. note::
// If this is set to < 400, 429 will be used instead.
type.v3.HttpStatus rate_limited_status = 10;
}
// Global rate limiting :ref:`architecture overview <arch_overview_global_rate_limit>`.

Loading…
Cancel
Save