higress
higress copied to clipboard
Implement a plugin that can replace the response body according to the configuration
Why do you need it?
实现一个插件,可以匹配应答和状态码返回自定义应答
Implement a plugin that can replace the response body according to the configuration
How could it be?
config example:
rules:
- match:
status: 403
body: "RBAC: access denied"
replace:
status: 200
body: "{\"code\":403,\"message\":\"User is not authenticated\"}"
content-type: "application/json;utf-8"
- match:
status: 503
body: "no healthy upstream"
replace:
status: 200
body: "{\"code\":503,\"message\":\"No Healthy Upstream\"}"
content-type: "application/json;utf-8"
Other related information
Add any other context or screenshots about the feature request here.
Hi