Skip to content

Commit

Permalink
cmd: Fix panic related to config filename (fix #5919)
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Apr 11, 2024
1 parent 185ed6f commit e1f4b83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func loadConfigWithLogger(logger *zap.Logger, configFile, adapterName string) ([
baseConfigExt := filepath.Ext(baseConfig)
if (strings.HasPrefix(baseConfig, "caddyfile") ||
strings.HasSuffix(baseConfig, ".caddyfile")) &&
caddyconfig.GetAdapter(baseConfigExt[1:]) == nil &&
(len(baseConfigExt) == 0 || caddyconfig.GetAdapter(baseConfigExt[1:]) == nil) &&
baseConfigExt != ".json" &&
adapterName == "" {
adapterName = "caddyfile"
Expand Down

0 comments on commit e1f4b83

Please sign in to comment.