Browse Source

fix: 解决防火墙多端口创建失败的问题 (#1988)

pull/1991/head
ssongliu 1 year ago committed by GitHub
parent
commit
f8f231253d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      backend/app/service/firewall.go

3
backend/app/service/firewall.go

@ -207,6 +207,7 @@ func (u *FirewallService) OperatePortRule(req dto.PortRuleOperate, reload bool)
return nil return nil
} }
itemPorts := req.Port
for _, proto := range protos { for _, proto := range protos {
if strings.Contains(req.Port, "-") { if strings.Contains(req.Port, "-") {
req.Protocol = proto req.Protocol = proto
@ -215,7 +216,7 @@ func (u *FirewallService) OperatePortRule(req dto.PortRuleOperate, reload bool)
} }
_ = u.addPortRecord(req) _ = u.addPortRecord(req)
} else { } else {
ports := strings.Split(req.Port, ",") ports := strings.Split(itemPorts, ",")
for _, port := range ports { for _, port := range ports {
if len(port) == 0 { if len(port) == 0 {
continue continue

Loading…
Cancel
Save