fix: 修复域名删除导致网站访问被 WAF 拦截的问题 (#6337)

Refs https://github.com/1Panel-dev/1Panel/issues/6336
This commit is contained in:
zhengkunwang 2024-09-02 18:23:37 +08:00 committed by GitHub
parent cf8aa86a67
commit 051f670453
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)