From f8f231253d2cf29868c6fb4f2f5a41822bc0d034 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 17 Aug 2023 16:58:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E9=98=B2=E7=81=AB?= =?UTF-8?q?=E5=A2=99=E5=A4=9A=E7=AB=AF=E5=8F=A3=E5=88=9B=E5=BB=BA=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#1988)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/firewall.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/app/service/firewall.go b/backend/app/service/firewall.go index 9db180c56..e00e832fa 100644 --- a/backend/app/service/firewall.go +++ b/backend/app/service/firewall.go @@ -207,6 +207,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 @@ -215,7 +216,7 @@ func (u *FirewallService) OperatePortRule(req dto.PortRuleOperate, reload bool) } _ = u.addPortRecord(req) } else { - ports := strings.Split(req.Port, ",") + ports := strings.Split(itemPorts, ",") for _, port := range ports { if len(port) == 0 { continue