Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 21:00 UTC
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>
WeidiDeng committed
Sep 27, 2025 at 00:46 UTC
b2ab419922e0dabc2956611531f73a6169ecc46f
1 file changed
+3
-1
modules.go
+3
-1
@@ -345,9 +345,11 @@ func StrictUnmarshalJSON(data []byte, v any) error {
345
return dec.Decode(v)
346
}
347
348
+var JSONRawMessageType = reflect.TypeFor[json.RawMessage]()
349
+
350
// isJSONRawMessage returns true if the type is encoding/json.RawMessage.
351
func isJSONRawMessage(typ reflect.Type) bool {
350
- return typ.PkgPath() == "encoding/json" && typ.Name() == "RawMessage"
352
+ return typ == JSONRawMessageType
353
}
354
355
// isModuleMapType returns true if the type is map[string]json.RawMessage.