Merge pull request 'move set content-type in client publish' (#394) from devstigneev/micro:v3_publish_bug into v3
All checks were successful
coverage / build (push) Successful in 1m19s
test / test (push) Successful in 2m13s

Reviewed-on: #394
This commit is contained in:
Василий Толстов 2025-01-17 15:57:30 +03:00
commit a8eda9d58d

View File

@ -588,7 +588,6 @@ func (n *noopClient) publish(ctx context.Context, ps []Message, opts ...PublishO
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
@ -600,6 +599,8 @@ func (n *noopClient) publish(ctx context.Context, ps []Message, opts ...PublishO
md.Set(k, v) md.Set(k, v)
} }
md[metadata.HeaderContentType] = p.ContentType()
var body []byte var body []byte
// passed in raw data // passed in raw data