mirror of https://github.com/daffainfo/nuclei.git
Use CRLF as delimiter for requests
parent
e63172d2bf
commit
d1c3be8199
|
@ -108,15 +108,7 @@ func (r *requestGenerator) makeHTTPRequestFromModel(ctx context.Context, data st
|
|||
|
||||
// makeHTTPRequestFromRaw creates a *http.Request from a raw request
|
||||
func (r *requestGenerator) makeHTTPRequestFromRaw(ctx context.Context, baseURL, data string, values, payloads map[string]interface{}) (*generatedRequest, error) {
|
||||
// Add trailing line to request body based on content type
|
||||
// handling multipart bodies differently.
|
||||
if !strings.HasSuffix(data, "\r\n") && !strings.HasSuffix(data, "\n") {
|
||||
if !strings.Contains(r.request.Headers["Content-Type"], "multipart") {
|
||||
data += "\n"
|
||||
} else {
|
||||
data += "\r\n"
|
||||
}
|
||||
}
|
||||
return r.handleRawWithPaylods(ctx, data, baseURL, values, payloads)
|
||||
}
|
||||
|
||||
|
|
|
@ -103,6 +103,11 @@ func (r *Request) Compile(options *protocols.ExecuterOptions) error {
|
|||
}
|
||||
|
||||
if len(r.Raw) > 0 {
|
||||
for i, raw := range r.Raw {
|
||||
if !strings.Contains(raw, "\r\n") {
|
||||
r.Raw[i] = strings.ReplaceAll(raw, "\n", "\r\n")
|
||||
}
|
||||
}
|
||||
r.rawhttpClient = httpclientpool.GetRawHTTP()
|
||||
}
|
||||
if len(r.Matchers) > 0 || len(r.Extractors) > 0 {
|
||||
|
|
Loading…
Reference in New Issue