move set content-type in client publish
All checks were successful
lint / lint (pull_request) Successful in 1m25s
test / test (pull_request) Successful in 2m56s

This commit is contained in:
Денис Евстигнеев 2025-01-17 17:57:44 +03:00
parent fa5602486a
commit a770c498e7

View File

@ -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