Add ability to process legacy requests

This commit is contained in:
Asim Aslam 2019-01-18 10:23:36 +00:00
parent 2cd2258731
commit f41be53ff8

View File

@ -153,9 +153,15 @@ func (c *rpcCodec) ReadHeader(r *codec.Message, t codec.MessageType) error {
err := c.codec.ReadHeader(&m, codec.Request)
// set the method/id
r.Method = m.Method
r.Endpoint = m.Endpoint
r.Id = m.Id
// TODO: remove the old legacy cruft
if len(r.Endpoint) == 0 {
r.Endpoint = r.Method
}
return err
}