From 051f6704534d3032d543eee149a47535bf512cb0 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:23:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AF=BC=E8=87=B4=E7=BD=91=E7=AB=99=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E8=A2=AB=20WAF=20=E6=8B=A6=E6=88=AA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#6337)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs https://github.com/1Panel-dev/1Panel/issues/6336 --- backend/app/service/website.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 260cc1661..a33c924ff 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -641,8 +641,10 @@ func (w WebsiteService) DeleteWebsiteDomain(domainId uint) error { wafSite := wafWebsite oldDomains := wafSite.Domains var newDomains []string + removed := false for _, domain := range oldDomains { - if domain == webSiteDomain.Domain { + if domain == webSiteDomain.Domain && !removed { + removed = true continue } newDomains = append(newDomains, domain)