Merge pull request 'move set content-type in client publish' (#138) from devstigneev/micro-client-grpc:v3 into v3
All checks were successful
test / test (push) Successful in 4m25s
All checks were successful
test / test (push) Successful in 4m25s
Reviewed-on: #138
This commit is contained in:
commit
cee07d11d4
3
grpc.go
3
grpc.go
@ -803,7 +803,6 @@ func (g *grpcClient) publish(ctx context.Context, ps []client.Message, opts ...c
|
|||||||
|
|
||||||
for _, p := range ps {
|
for _, p := range ps {
|
||||||
md := metadata.Copy(omd)
|
md := metadata.Copy(omd)
|
||||||
md[metadata.HeaderContentType] = p.ContentType()
|
|
||||||
topic := p.Topic()
|
topic := p.Topic()
|
||||||
if len(exchange) > 0 {
|
if len(exchange) > 0 {
|
||||||
topic = exchange
|
topic = exchange
|
||||||
@ -815,6 +814,8 @@ func (g *grpcClient) publish(ctx context.Context, ps []client.Message, opts ...c
|
|||||||
md.Set(k, v)
|
md.Set(k, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
md[metadata.HeaderContentType] = p.ContentType()
|
||||||
|
|
||||||
// passed in raw data
|
// passed in raw data
|
||||||
if d, ok := p.Payload().(*codec.Frame); ok {
|
if d, ok := p.Payload().(*codec.Frame); ok {
|
||||||
body = d.Data
|
body = d.Data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user