Merge pull request 'move set content-type in client publish' (#123) from devstigneev/micro-client-http:v3 into v3
All checks were successful
test / test (push) Successful in 3m56s

Reviewed-on: #123
This commit is contained in:
Василий Толстов 2025-01-18 15:38:23 +03:00
commit a9829b5da0

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