mirror of
https://github.com/caddyserver/caddy.git
synced 2025-09-29 15:31:06 -04:00
core: use reflect.TypeFor to check for encoding/json.RawMessage (#7274)
* check if the raw message type is the json v2 type * use reflect.TypeFor to check for encoding/json.RawMessage --------- Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
This commit is contained in:
parent
bc0e184130
commit
b2ab419922
@ -345,9 +345,11 @@ func StrictUnmarshalJSON(data []byte, v any) error {
|
||||
return dec.Decode(v)
|
||||
}
|
||||
|
||||
var JSONRawMessageType = reflect.TypeFor[json.RawMessage]()
|
||||
|
||||
// isJSONRawMessage returns true if the type is encoding/json.RawMessage.
|
||||
func isJSONRawMessage(typ reflect.Type) bool {
|
||||
return typ.PkgPath() == "encoding/json" && typ.Name() == "RawMessage"
|
||||
return typ == JSONRawMessageType
|
||||
}
|
||||
|
||||
// isModuleMapType returns true if the type is map[string]json.RawMessage.
|
||||
|
Loading…
x
Reference in New Issue
Block a user