Files
higress/plugins/wasm-go/extensions/gw-error-format/gw-error-format.yaml
jiahao zhang daffd18674 add plugin gw-error-format (#116)
Co-authored-by: 澄潭 <zty98751@alibaba-inc.com>
2023-05-04 09:42:41 +08:00

31 lines
917 B
YAML

apiVersion: extensions.istio.io/v1alpha1
kind: WasmPlugin
metadata:
name: gw-error-format
namespace: higress-system
spec:
selector:
matchLabels:
higress: higress-system-higress-gateway
pluginConfig:
rules:
- match:
statuscode: "200"
responsebody: "bar"
replace:
statuscode: "401"
responsebody: "{\"code\":401,\"message\":\"User is not authenticated\"}"
- match:
statuscode: "503"
responsebody: "no healthy upstream"
replace:
statuscode: "200"
responsebody: "{\"code\":404,\"message\":\"No Healthy Service\"}"
set_header:
- access-control-allow-credentials: "true"
- access-control-allow-origin: "*"
- access-control-expose-headers: "*"
- content-type: "application/json;charset=UTF-8"
- custom-header: "HelloWorld"
url: oci://docker.io/zhangjiahaol/envoy-plugin:gw-error-format-2.0.0