From a770c498e720d96aadcfe13d036e83612a2a4324 Mon Sep 17 00:00:00 2001 From: Evstigneev Denis Date: Fri, 17 Jan 2025 17:57:44 +0300 Subject: [PATCH] move set content-type in client publish --- http.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/http.go b/http.go index 25b9e0d..11fa784 100644 --- a/http.go +++ b/http.go @@ -708,7 +708,7 @@ func (c *httpClient) 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 @@ -720,6 +720,8 @@ func (c *httpClient) 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 -- 2.47.1