Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a plugin that can replace the response body according to the configuration #62

Closed
johnlanni opened this issue Nov 23, 2022 · 1 comment · Fixed by #116
Closed
Assignees

Comments

@johnlanni
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants