Ice3man543 2021-02-04 22:29:36 +05:30
parent d1c3be8199
commit f2e3033d24
2 changed files with 3 additions and 1 deletions

View File

@ -102,6 +102,9 @@ func (r *Request) Compile(options *protocols.ExecuterOptions) error {
r.customHeaders[parts[0]] = strings.TrimSpace(parts[1]) 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 { if len(r.Raw) > 0 {
for i, raw := range r.Raw { for i, raw := range r.Raw {
if !strings.Contains(raw, "\r\n") { if !strings.Contains(raw, "\r\n") {

View File

@ -246,7 +246,6 @@ func (r *Request) executeRequest(reqURL string, request *generatedRequest, dynam
if parsed, err := url.Parse(formedURL); err == nil { if parsed, err := url.Parse(formedURL); err == nil {
hostname = parsed.Hostname() hostname = parsed.Hostname()
} }
request.rawRequest.Data = strings.ReplaceAll(request.rawRequest.Data, "\n", "\r\n")
options := request.original.rawhttpClient.Options options := request.original.rawhttpClient.Options
options.AutomaticContentLength = !r.DisableAutoContentLength options.AutomaticContentLength = !r.DisableAutoContentLength
options.AutomaticHostHeader = !r.DisableAutoHostname options.AutomaticHostHeader = !r.DisableAutoHostname