@marcel91200 / caddy Mirror · read-only / commits / 8f87c5d9
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 12, 13:15 UTC

cmd: Only validate config is proper JSON if config slice has data (#6250)

* cmd: fix error when running without config * ci: add smoke test

Mohammed Al Sahaf committed Apr 19, 2024 at 00:40 UTC 8f87c5d9938d64942f193a599a6d5472edeb15da
2 files changed +7 -1
.github/workflows/ci.yml
+6
@@ -101,6 +101,12 @@ jobs:
101 run: |
102 go build -tags nobdger -trimpath -ldflags="-w -s" -v
103
104 + - name: Smoke test Caddy
105 + working-directory: ./cmd/caddy
106 + run: |
107 + ./caddy start
108 + ./caddy stop
109 +
110 - name: Publish Build Artifact
111 uses: actions/upload-artifact@v4
112 with:
cmd/main.go
+1 -1
@@ -199,7 +199,7 @@ func loadConfigWithLogger(logger *zap.Logger, configFile, adapterName string) ([
199 zap.Int("line", warn.Line))
200 }
201 config = adaptedConfig
202 - } else {
202 + } else if len(config) != 0 {
203 // validate that the config is at least valid JSON
204 err = json.Unmarshal(config, new(any))
205 if err != nil {