mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-26 13:43:47 +03:00
cmd: Fix defaulting admin address if empty in config, fixes reload
(#4674)
This commit is contained in:
parent
734acc776a
commit
22d8edb984
1 changed files with 4 additions and 2 deletions
|
@ -735,7 +735,7 @@ func DetermineAdminAPIAddress(address, configFile, configAdapter string) (string
|
|||
return "", fmt.Errorf("no config file to load")
|
||||
}
|
||||
|
||||
// get the address of the admin listener
|
||||
// get the address of the admin listener if set
|
||||
if len(config) > 0 {
|
||||
var tmpStruct struct {
|
||||
Admin caddy.AdminConfig `json:"admin"`
|
||||
|
@ -744,7 +744,9 @@ func DetermineAdminAPIAddress(address, configFile, configAdapter string) (string
|
|||
if err != nil {
|
||||
return "", fmt.Errorf("unmarshaling admin listener address from config: %v", err)
|
||||
}
|
||||
return tmpStruct.Admin.Listen, nil
|
||||
if tmpStruct.Admin.Listen != "" {
|
||||
return tmpStruct.Admin.Listen, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue