mirror of
https://github.com/alibaba/higress.git
synced 2026-06-01 16:47:27 +08:00
feat(wasm-go): add field reroute to disable route reselection (#2739)
This commit is contained in:
@@ -28,8 +28,28 @@ static_resources:
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/"
|
||||
route:
|
||||
cluster: httpbin
|
||||
headers: [
|
||||
{
|
||||
name: "reroute",
|
||||
string_match: { "exact": "false" }
|
||||
}
|
||||
]
|
||||
direct_response:
|
||||
status: 200
|
||||
body: { inline_string: "no rerouting" }
|
||||
- match:
|
||||
prefix: "/"
|
||||
headers: [
|
||||
{
|
||||
name: "reroute",
|
||||
string_match: { "exact": "true" }
|
||||
}
|
||||
]
|
||||
direct_response:
|
||||
status: 200
|
||||
body: { inline_string: "rerouting" }
|
||||
# route:
|
||||
# cluster: httpbin
|
||||
http_filters:
|
||||
- name: wasmdemo
|
||||
typed_config:
|
||||
@@ -47,25 +67,14 @@ static_resources:
|
||||
"@type": "type.googleapis.com/google.protobuf.StringValue"
|
||||
value: |
|
||||
{
|
||||
"reroute": false,
|
||||
"reqRules": [
|
||||
{
|
||||
"operate": "replace",
|
||||
"headers": [
|
||||
{
|
||||
"key": "hello",
|
||||
"newValue": "higress"
|
||||
}
|
||||
],
|
||||
"querys": [
|
||||
{
|
||||
"key": "k1",
|
||||
"newValue": "newQueryV1"
|
||||
}
|
||||
],
|
||||
"body": [
|
||||
{
|
||||
"key": "k2",
|
||||
"newValue": "newBodyV2"
|
||||
"key": "reroute",
|
||||
"newValue": "true"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -74,19 +83,19 @@ static_resources:
|
||||
- name: envoy.filters.http.router
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
|
||||
clusters:
|
||||
- name: httpbin
|
||||
connect_timeout: 30s
|
||||
type: LOGICAL_DNS
|
||||
# Comment out the following line to test on v6 networks
|
||||
dns_lookup_family: V4_ONLY
|
||||
lb_policy: ROUND_ROBIN
|
||||
load_assignment:
|
||||
cluster_name: httpbin
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: httpbin
|
||||
port_value: 80
|
||||
# clusters:
|
||||
# - name: httpbin
|
||||
# connect_timeout: 30s
|
||||
# type: LOGICAL_DNS
|
||||
# # Comment out the following line to test on v6 networks
|
||||
# dns_lookup_family: V4_ONLY
|
||||
# lb_policy: ROUND_ROBIN
|
||||
# load_assignment:
|
||||
# cluster_name: httpbin
|
||||
# endpoints:
|
||||
# - lb_endpoints:
|
||||
# - endpoint:
|
||||
# address:
|
||||
# socket_address:
|
||||
# address: httpbin
|
||||
# port_value: 80
|
||||
Reference in New Issue
Block a user