feat: validate Worker protocol and verify process crash recovery
This commit is contained in:
@@ -214,6 +214,18 @@ func exactFields(raw []byte, t reflect.Type) error {
|
||||
if t == reflect.TypeOf(time.Time{}) || t == reflect.TypeOf(json.RawMessage{}) {
|
||||
return nil
|
||||
}
|
||||
if t.Kind() == reflect.Slice || t.Kind() == reflect.Array {
|
||||
var values []json.RawMessage
|
||||
if err := json.Unmarshal(raw, &values); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, value := range values {
|
||||
if err := exactFields(value, t.Elem()); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if t.Kind() != reflect.Struct {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user