From e03b728240888ca0cb3882b9f7e5bd8e12dd2d27 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Sun, 29 Sep 2024 18:25:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E7=AD=BE=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20ipv6=20(#6627)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs https://github.com/1Panel-dev/1Panel/issues/6623 --- backend/app/service/website_ca.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/backend/app/service/website_ca.go b/backend/app/service/website_ca.go index b10402278..3a52dbbd5 100644 --- a/backend/app/service/website_ca.go +++ b/backend/app/service/website_ca.go @@ -217,15 +217,14 @@ func (w WebsiteCAService) ObtainSSL(req request.WebsiteCAObtain) (*model.Website if req.Domains != "" { domainArray := strings.Split(req.Domains, "\n") for _, domain := range domainArray { - if !common.IsValidDomain(domain) { - err = buserr.WithName("ErrDomainFormat", domain) - return nil, err - } else { - if ipAddress := net.ParseIP(domain); ipAddress == nil { - domains = append(domains, domain) - } else { - ips = append(ips, ipAddress) + if ipAddress := net.ParseIP(domain); ipAddress == nil { + if !common.IsValidDomain(domain) { + err = buserr.WithName("ErrDomainFormat", domain) + return nil, err } + domains = append(domains, domain) + } else { + ips = append(ips, ipAddress) } } if len(domains) > 0 {