Skip to content

Commit 58d6ae7

Browse files
committed
Add default value for vars in MatchRule struct
1 parent a23d9b1 commit 58d6ae7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/plugin/traffic_split.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct WeightedUpstream {
2424

2525
#[derive(Debug, Serialize, Deserialize, Validate)]
2626
struct MatchRule {
27+
#[serde(default)]
2728
pub vars: Vec<Vec<String>>, // 格式如 [["arg_name", "==", "val"], ["header_x", "~=", "reg"]]
2829
#[validate(nested)]
2930
pub weighted_upstreams: Vec<WeightedUpstream>,

0 commit comments

Comments
 (0)