summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2023-02-22 13:39:40 -0500
committerGitHub <noreply@github.com>2023-02-22 11:39:40 -0700
commit79de6df93d0404790c3bfecfefa9e1458ffcff75 (patch)
treeb4056129957e9faaeecebe6e01f3a4101130d862 /cmd
parent8bc05e598da0068358a2876c45f92f2c77455341 (diff)
cmd: Strict unmarshal for validate (#5383)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/commandfuncs.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go
index 62afae2..cc5666b 100644
--- a/cmd/commandfuncs.go
+++ b/cmd/commandfuncs.go
@@ -490,7 +490,7 @@ func cmdAdaptConfig(fl Flags) (int, error) {
// validate output if requested
if adaptCmdValidateFlag {
var cfg *caddy.Config
- err = json.Unmarshal(adaptedConfig, &cfg)
+ err = caddy.StrictUnmarshalJSON(adaptedConfig, &cfg)
if err != nil {
return caddy.ExitCodeFailedStartup, fmt.Errorf("decoding config: %v", err)
}
@@ -523,7 +523,7 @@ func cmdValidateConfig(fl Flags) (int, error) {
input = caddy.RemoveMetaFields(input)
var cfg *caddy.Config
- err = json.Unmarshal(input, &cfg)
+ err = caddy.StrictUnmarshalJSON(input, &cfg)
if err != nil {
return caddy.ExitCodeFailedStartup, fmt.Errorf("decoding config: %v", err)
}