diff --git a/rule/provider/parse.go b/rule/provider/parse.go index 230bc888..4dc81f90 100644 --- a/rule/provider/parse.go +++ b/rule/provider/parse.go @@ -64,6 +64,9 @@ func parseRule(tp, payload, target string, params []string) (C.Rule, error) { parsed = RC.NewDomainSuffix(payload, target) case "DOMAIN-KEYWORD": parsed = RC.NewDomainKeyword(payload, target) + case "GEOIP": + noResolve := RC.HasNoResolve(params) + parsed, parseErr = RC.NewGEOIP(payload, target, noResolve) case "GEOSITE": parsed, parseErr = RC.NewGEOSITE(payload, target) case "IP-CIDR", "IP-CIDR6": @@ -79,9 +82,6 @@ func parseRule(tp, payload, target string, params []string) (C.Rule, error) { parsed, parseErr = RC.NewProcess(payload, target, true) case "PROCESS-PATH": parsed, parseErr = RC.NewProcess(payload, target, false) - case "GEOIP": - noResolve := RC.HasNoResolve(params) - parsed, parseErr = RC.NewGEOIP(payload, target, noResolve) default: parseErr = fmt.Errorf("unsupported rule type %s", tp) } diff --git a/rule/provider/provider.go b/rule/provider/provider.go index 19905bce..1169d4c4 100644 --- a/rule/provider/provider.go +++ b/rule/provider/provider.go @@ -28,7 +28,8 @@ type RulePayload struct { key: Domain or IP Cidr value: Rule type or is empty */ - Rules []string `yaml:"payload"` + Rules []string `yaml:"payload"` + Rules2 []string `yaml:"rules"` } type ruleStrategy interface { @@ -144,5 +145,5 @@ func rulesParse(buf []byte) (interface{}, error) { return nil, err } - return rulePayload.Rules, nil + return append(rulePayload.Rules, rulePayload.Rules2...), nil }