mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03:00
cmd: Fix panic related to config filename (fix #5919)
This commit is contained in:
parent
185ed6fe7c
commit
e1f4b83ffa
1 changed files with 1 additions and 1 deletions
|
@ -165,7 +165,7 @@ func loadConfigWithLogger(logger *zap.Logger, configFile, adapterName string) ([
|
||||||
baseConfigExt := filepath.Ext(baseConfig)
|
baseConfigExt := filepath.Ext(baseConfig)
|
||||||
if (strings.HasPrefix(baseConfig, "caddyfile") ||
|
if (strings.HasPrefix(baseConfig, "caddyfile") ||
|
||||||
strings.HasSuffix(baseConfig, ".caddyfile")) &&
|
strings.HasSuffix(baseConfig, ".caddyfile")) &&
|
||||||
caddyconfig.GetAdapter(baseConfigExt[1:]) == nil &&
|
(len(baseConfigExt) == 0 || caddyconfig.GetAdapter(baseConfigExt[1:]) == nil) &&
|
||||||
baseConfigExt != ".json" &&
|
baseConfigExt != ".json" &&
|
||||||
adapterName == "" {
|
adapterName == "" {
|
||||||
adapterName = "caddyfile"
|
adapterName = "caddyfile"
|
||||||
|
|
Loading…
Reference in a new issue