ratelimit add support for custom http response code#20520
ratelimit add support for custom http response code#20520htuch merged 6 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: xiada <maxxd@qq.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
|
I am curious in which cases it helps, please share more details. |
api/envoy/extensions/filters/http/ratelimit/v3/rate_limit.proto
Outdated
Show resolved
Hide resolved
In our case, we usually use 5xx code to inform the client that the backend is is not able to provide service when it depends on the current capacity of the backend |
| : absl::nullopt), | ||
| http_context_(http_context), stat_names_(scope.symbolTable()) {} | ||
| http_context_(http_context), stat_names_(scope.symbolTable()), | ||
| status_(toErrorCode(config.status().code())) {} |
There was a problem hiding this comment.
Could you add test for those new code? Then the code LGTM.
api/envoy/extensions/filters/http/ratelimit/v3/rate_limit.proto
Outdated
Show resolved
Hide resolved
Signed-off-by: xiada <maxxd@qq.com>
Signed-off-by: xiada <maxxd@qq.com>
| const std::string rate_limited_status_config_ = R"EOF( | ||
| domain: foo | ||
| rate_limited_status: | ||
| code: 503 |
There was a problem hiding this comment.
It would be great to test the case of status code < 400
There was a problem hiding this comment.
ok,i think it's good to add another test for this case?I will do it later,thanks~
There was a problem hiding this comment.
@soulxu I have add the test for case of status code < 400,PTAL,thanks~
Signed-off-by: xiada <maxxd@qq.com>
soulxu
left a comment
There was a problem hiding this comment.
LGTM, thanks for all the update!
htuch
left a comment
There was a problem hiding this comment.
Actually, one last thing before merging, can you please add an entry to https://github.com/envoyproxy/envoy/blob/main/docs/root/version_history/current.rst and link to the new field from there? Thanks.
Signed-off-by: xiada <maxxd@qq.com>
|
@htuch I have done the changes and also update https://github.com/envoyproxy/envoy/blob/main/docs/root/configuration/http/http_filters/rate_limit_filter.rst, PTAL,thanks~ |
Signed-off-by: xiada <maxxd@qq.com>
Signed-off-by: xiada maxxd@qq.com
Commit Message:ratelimit add support for custom http response code
Additional Description:
Risk Level:low
Testing:
Docs Changes:
Release Notes:
Platform Specific Features: