client/noop: fix MessageMetadata option #274

Merged
vtolstov merged 1 commits from client-noop-metadata into v3 2023-10-26 03:07:14 +03:00
Showing only changes of commit 089e7b6812 - Show all commits

View File

@ -490,6 +490,13 @@ func (n *noopClient) publish(ctx context.Context, ps []Message, opts ...PublishO
if !ok { if !ok {
md = metadata.New(0) 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() md[metadata.HeaderContentType] = p.ContentType()
topic := p.Topic() topic := p.Topic()