From f2e3033d246950233013a21c07b20720eb91559f Mon Sep 17 00:00:00 2001 From: Ice3man543 Date: Thu, 4 Feb 2021 22:29:36 +0530 Subject: [PATCH] Misc --- v2/pkg/protocols/http/http.go | 3 +++ v2/pkg/protocols/http/request.go | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/v2/pkg/protocols/http/http.go b/v2/pkg/protocols/http/http.go index ee30a1ec..4557e78e 100644 --- a/v2/pkg/protocols/http/http.go +++ b/v2/pkg/protocols/http/http.go @@ -102,6 +102,9 @@ func (r *Request) Compile(options *protocols.ExecuterOptions) error { r.customHeaders[parts[0]] = strings.TrimSpace(parts[1]) } + if r.Body != "" && !strings.Contains(r.Body, "\r\n") { + r.Body = strings.ReplaceAll(r.Body, "\n", "\r\n") + } if len(r.Raw) > 0 { for i, raw := range r.Raw { if !strings.Contains(raw, "\r\n") { diff --git a/v2/pkg/protocols/http/request.go b/v2/pkg/protocols/http/request.go index 128d8dd5..96b2db93 100644 --- a/v2/pkg/protocols/http/request.go +++ b/v2/pkg/protocols/http/request.go @@ -246,7 +246,6 @@ func (r *Request) executeRequest(reqURL string, request *generatedRequest, dynam if parsed, err := url.Parse(formedURL); err == nil { hostname = parsed.Hostname() } - request.rawRequest.Data = strings.ReplaceAll(request.rawRequest.Data, "\n", "\r\n") options := request.original.rawhttpClient.Options options.AutomaticContentLength = !r.DisableAutoContentLength options.AutomaticHostHeader = !r.DisableAutoHostname