diff options
author | Francis Lavoie <[email protected]> | 2023-02-22 13:39:40 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2023-02-22 11:39:40 -0700 |
commit | 79de6df93d0404790c3bfecfefa9e1458ffcff75 (patch) | |
tree | b4056129957e9faaeecebe6e01f3a4101130d862 /cmd | |
parent | 8bc05e598da0068358a2876c45f92f2c77455341 (diff) | |
download | caddy-79de6df93d0404790c3bfecfefa9e1458ffcff75.tar.gz caddy-79de6df93d0404790c3bfecfefa9e1458ffcff75.zip |
cmd: Strict unmarshal for validate (#5383)
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/commandfuncs.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go index 62afae2bb..cc5666bb1 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) } |