diff --git a/v2/pkg/protocols/http/utils.go b/v2/pkg/protocols/http/utils.go index 273aec9cf..bee2ef557 100644 --- a/v2/pkg/protocols/http/utils.go +++ b/v2/pkg/protocols/http/utils.go @@ -133,7 +133,7 @@ func dump(req *generatedRequest, reqURL string) ([]byte, error) { // The original req.Body gets modified indirectly by httputil.DumpRequestOut so we set it again to nil if it was empty // Otherwise redirects like 307/308 would fail (as they require the body to be sent along) if len(bodyBytes) == 0 { - req.request.Request.ContentLength = int64(len(bodyBytes)) + req.request.Request.ContentLength = 0 req.request.Request.Body = nil }