summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorMohammed Al Sahaf <[email protected]>2024-04-19 00:40:12 +0300
committerGitHub <[email protected]>2024-04-18 15:40:12 -0600
commit8f87c5d9938d64942f193a599a6d5472edeb15da (patch)
tree1623f5c344d6386821eed3b894bc75462c2c6f73 /cmd
parentc6673ad4d8c3253179d697f06aac458e48e56546 (diff)
downloadcaddy-8f87c5d9938d64942f193a599a6d5472edeb15da.tar.gz
caddy-8f87c5d9938d64942f193a599a6d5472edeb15da.zip
cmd: Only validate config is proper JSON if config slice has data (#6250)
* cmd: fix error when running without config * ci: add smoke test
Diffstat (limited to 'cmd')
-rw-r--r--cmd/main.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/main.go b/cmd/main.go
index ac9786faf..31a121aa6 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -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 {