From f5b0568eafcee56c4b0dd2547f388fe308628367 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Thu, 20 Apr 2023 14:14:04 +0200 Subject: [PATCH] Make sure we set the content-type we were not setting properly since it was store in pm.contentType --- gosmee/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gosmee/client.go b/gosmee/client.go index 634c91a..41dc535 100644 --- a/gosmee/client.go +++ b/gosmee/client.go @@ -239,6 +239,10 @@ func (c goSmee) replayData(b []byte) error { for k, v := range pm.headers { req.Header.Add(k, v) } + // add content-type if it's not already set + if _, ok := pm.headers["Content-Type"]; !ok { + req.Header.Add("Content-Type", pm.contentType) + } resp, err := client.Do(req) if err != nil { return err