1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

Allow bytes.Frame to be set to sent just bytes

This commit is contained in:
Asim Aslam
2019-01-16 15:27:57 +00:00
parent a9c0b95603
commit 784a89b488
3 changed files with 32 additions and 13 deletions

View File

@ -106,12 +106,12 @@ func (c *rpcCodec) Write(m *codec.Message, body interface{}) error {
m.Header["X-Micro-Service"] = m.Target
m.Header["X-Micro-Endpoint"] = m.Endpoint
// if body is bytes don't encode
// if body is bytes Frame don't encode
if body != nil {
b, ok := body.([]byte)
b, ok := body.(*raw.Frame)
if ok {
// set body
m.Body = b
m.Body = b.Data
body = nil
}
}