Skip to content

Commit

Permalink
FIX: skip unknown fields
Browse files Browse the repository at this point in the history
  • Loading branch information
sinomiko committed Feb 7, 2025
1 parent 74a5474 commit 8e3853b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion protocol/brpc-http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ func jsonDecode(buf []byte, v interface{}) error {
if len(buf) == 0 {
return nil
}
return protojson.Unmarshal(buf, msg)
opts := protojson.UnmarshalOptions{
DiscardUnknown: true,
}
return opts.Unmarshal(buf, msg)
}

func protoEncode(v interface{}) ([]byte, error) {
Expand Down

0 comments on commit 8e3853b

Please sign in to comment.