From ddc9f74a71c73b58b3df79342b234442b5e036da Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Thu, 25 Oct 2018 00:09:55 +0800 Subject: [PATCH] Fix: GET /rules format --- hub/rules.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hub/rules.go b/hub/rules.go index 96ddc26c..c91120e8 100644 --- a/hub/rules.go +++ b/hub/rules.go @@ -15,8 +15,8 @@ func ruleRouter() http.Handler { } type Rule struct { - Name string `json:"name"` - Payload string `json:"type"` + Type string `json:"type"` + Payload string `json:"payload"` Proxy string `json:"proxy"` } @@ -30,7 +30,7 @@ func getRules(w http.ResponseWriter, r *http.Request) { var rules []Rule for _, rule := range rawRules { rules = append(rules, Rule{ - Name: rule.RuleType().String(), + Type: rule.RuleType().String(), Payload: rule.Payload(), Proxy: rule.Adapter(), })