mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-25 14:36:34 +08:00
修复WAF策略模式为空导致动作不起作用的问题
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user