fix grpc json streaming by setting content sub type (#1089)

This commit is contained in:
Asim Aslam
2020-01-07 18:37:34 +00:00
committed by Vasiliy Tolstov
parent aa7d6aada3
commit 74e52bdb3e
2 changed files with 7 additions and 1 deletions

View File

@@ -93,10 +93,12 @@ func (jsonCodec) Marshal(v interface{}) ([]byte, error) {
}
func (jsonCodec) Unmarshal(data []byte, v interface{}) error {
if len(data) == 0 {
return nil
}
if pb, ok := v.(proto.Message); ok {
return jsonpb.Unmarshal(b.NewReader(data), pb)
}
return json.Unmarshal(data, v)
}