From d5360e2804625f75cd0debbcc66dc85ed0374d75 Mon Sep 17 00:00:00 2001 From: Evstigneev Denis Date: Fri, 17 Jan 2025 17:52:22 +0300 Subject: [PATCH] move set content-type in client publish --- grpc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grpc.go b/grpc.go index 4caee03..d80a072 100644 --- a/grpc.go +++ b/grpc.go @@ -803,7 +803,6 @@ func (g *grpcClient) publish(ctx context.Context, ps []client.Message, opts ...c for _, p := range ps { md := metadata.Copy(omd) - md[metadata.HeaderContentType] = p.ContentType() topic := p.Topic() if len(exchange) > 0 { topic = exchange @@ -815,6 +814,8 @@ func (g *grpcClient) publish(ctx context.Context, ps []client.Message, opts ...c md.Set(k, v) } + md[metadata.HeaderContentType] = p.ContentType() + // passed in raw data if d, ok := p.Payload().(*codec.Frame); ok { body = d.Data