1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

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

This commit is contained in:
ssongliu 2023-08-17 16:58:10 +08:00 committed by wanghe-fit2cloud
parent 27bd4a63ef
commit cb1b6742d4

View File

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