增加WAF策略日志设置

This commit is contained in:
GoEdgeLab
2022-04-21 20:00:56 +08:00
parent 8059ff4e65
commit fe520744b0
3 changed files with 49 additions and 3 deletions

View File

@@ -293,7 +293,15 @@ func (this *HTTPFirewallPolicyService) UpdateHTTPFirewallPolicy(ctx context.Cont
}
}
err = models.SharedHTTPFirewallPolicyDAO.UpdateFirewallPolicy(tx, req.HttpFirewallPolicyId, req.IsOn, req.Name, req.Description, inboundConfigJSON, outboundConfigJSON, req.BlockOptionsJSON, req.Mode, req.UseLocalFirewall, synFloodConfig)
var logConfig = &firewallconfigs.HTTPFirewallPolicyLogConfig{}
if len(req.LogJSON) > 0 {
err = json.Unmarshal(req.LogJSON, logConfig)
if err != nil {
return nil, err
}
}
err = models.SharedHTTPFirewallPolicyDAO.UpdateFirewallPolicy(tx, req.HttpFirewallPolicyId, req.IsOn, req.Name, req.Description, inboundConfigJSON, outboundConfigJSON, req.BlockOptionsJSON, req.Mode, req.UseLocalFirewall, synFloodConfig, logConfig)
if err != nil {
return nil, err
}