Skip to content

Commit

Permalink
added special case support for caddyfile suffix, case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
omalk98 committed Oct 27, 2023
1 parent 3f55efc commit 4fea65f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ func loadConfigWithLogger(logger *zap.Logger, configFile, adapterName string) ([
// as a special case, if a config file called "Caddyfile" was
// specified, and no adapter is specified, assume caddyfile adapter
// for convenience
if strings.HasPrefix(filepath.Base(configFile), "Caddyfile") &&
baseConfig := strings.ToLower(filepath.Base(configFile))
if (strings.HasPrefix(baseConfig, "caddyfile") ||
strings.HasSuffix(baseConfig, "caddyfile")) &&
filepath.Ext(configFile) != ".json" &&
adapterName == "" {
adapterName = "caddyfile"
Expand Down

0 comments on commit 4fea65f

Please sign in to comment.