mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-13 09:06:41 +00:00
cmd: Only validate config is proper JSON if config slice has data (#6250)
* cmd: fix error when running without config * ci: add smoke test
This commit is contained in:
parent
c6673ad4d8
commit
8f87c5d993
2 changed files with 7 additions and 1 deletions
|
|
@ -199,7 +199,7 @@ func loadConfigWithLogger(logger *zap.Logger, configFile, adapterName string) ([
|
|||
zap.Int("line", warn.Line))
|
||||
}
|
||||
config = adaptedConfig
|
||||
} else {
|
||||
} else if len(config) != 0 {
|
||||
// validate that the config is at least valid JSON
|
||||
err = json.Unmarshal(config, new(any))
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue