fix: newV2board rule regexp pattern

This commit is contained in:
Senis John 2022-12-15 09:55:49 +08:00
parent a6dbf757e9
commit 9ef39925fd
No known key found for this signature in database
GPG Key ID: 845E9E4727C3E1A4
2 changed files with 2 additions and 2 deletions

View File

@ -255,7 +255,7 @@ func (c *APIClient) GetNodeRule() (*[]api.DetectRule, error) {
if r["action"] == "block" {
ruleListItem := api.DetectRule{
ID: i,
Pattern: regexp.MustCompile(r["match"].(string)),
Pattern: regexp.MustCompile(strings.TrimPrefix(r["match"].(string), "regexp:")),
}
ruleList = append(ruleList, ruleListItem)
}

View File

@ -535,7 +535,7 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.
}
if handler == nil {
handler = d.ohm.GetHandler(inTag) // Default outbound hander tag should be as same as the inbound tag
handler = d.ohm.GetHandler(inTag) // Default outbound handler tag should be as same as the inbound tag
}
// If there is no outbound with tag as same as the inbound tag