From 089e7b6812dcc2963cde255d67dd527d0702d0a0 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 26 Oct 2023 03:06:39 +0300 Subject: [PATCH] client/noop: fix MessageMetadata option Signed-off-by: Vasiliy Tolstov --- client/noop.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/noop.go b/client/noop.go index dfcf9025..52a4da68 100644 --- a/client/noop.go +++ b/client/noop.go @@ -490,6 +490,13 @@ func (n *noopClient) publish(ctx context.Context, ps []Message, opts ...PublishO if !ok { md = metadata.New(0) } + + iter := p.Metadata().Iterator() + var k, v string + for iter.Next(&k, &v) { + md.Set(k, v) + } + md[metadata.HeaderContentType] = p.ContentType() topic := p.Topic() -- 2.45.2