mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-29 12:16:16 +08:00
Improve logic related to error handling on SiteExists call
No need to check if SiteExists if the config is not managed or the name does not even qualify.
This commit is contained in:
parent
15d25f1ca4
commit
628920e20e
|
@ -133,6 +133,10 @@ func (c *Config) ObtainCert(allowPrompts bool) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Config) obtainCertName(name string, allowPrompts bool) error {
|
func (c *Config) obtainCertName(name string, allowPrompts bool) error {
|
||||||
|
if !c.Managed || !HostQualifies(name) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
storage, err := c.StorageFor(c.CAUrl)
|
storage, err := c.StorageFor(c.CAUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -143,7 +147,7 @@ func (c *Config) obtainCertName(name string, allowPrompts bool) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !c.Managed || !HostQualifies(name) || siteExists {
|
if siteExists {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user