修复WAF策略模式为空导致动作不起作用的问题

This commit is contained in:
GoEdgeLab
2021-10-03 08:35:28 +08:00
parent 1135a03d15
commit a1ff7b09d1
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -57,6 +57,9 @@ func (this *WAFManager) convertWAF(policy *firewallconfigs.HTTPFirewallPolicy) (
if policy == nil {
return nil, errors.New("policy should not be nil")
}
if len(policy.Mode) == 0 {
policy.Mode = firewallconfigs.FirewallModeDefend
}
w := &waf.WAF{
Id: strconv.FormatInt(policy.Id, 10),
IsOn: policy.IsOn,