Add X-Micro-Target header
This commit is contained in:
parent
5f2ce6fac4
commit
28324412a4
@ -105,12 +105,15 @@ func newRpcPlusCodec(req *transport.Message, client transport.Client, c codec.Ne
|
|||||||
|
|
||||||
func (c *rpcPlusCodec) WriteRequest(req *request, body interface{}) error {
|
func (c *rpcPlusCodec) WriteRequest(req *request, body interface{}) error {
|
||||||
c.buf.wbuf.Reset()
|
c.buf.wbuf.Reset()
|
||||||
|
|
||||||
m := &codec.Message{
|
m := &codec.Message{
|
||||||
Id: req.Seq,
|
Id: req.Seq,
|
||||||
Target: req.Service,
|
Target: req.Service,
|
||||||
Method: req.ServiceMethod,
|
Method: req.ServiceMethod,
|
||||||
Type: codec.Request,
|
Type: codec.Request,
|
||||||
Header: map[string]string{},
|
Header: map[string]string{
|
||||||
|
"X-Micro-Target": req.Service,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
if err := c.codec.Write(m, body); err != nil {
|
if err := c.codec.Write(m, body); err != nil {
|
||||||
return errors.InternalServerError("go.micro.client.codec", err.Error())
|
return errors.InternalServerError("go.micro.client.codec", err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user