mirror of https://github.com/daffainfo/nuclei.git
Misc
parent
be08e60ab6
commit
4b21de68c8
|
@ -79,11 +79,6 @@ func (r *Request) GetID() string {
|
|||
|
||||
// Compile compiles the protocol request for further execution.
|
||||
func (r *Request) Compile(options *protocols.ExecuterOptions) error {
|
||||
// Add User-Agent value randomly to the customHeaders slice if `random-agent` flag is given
|
||||
if r.options.Options.RandomAgent {
|
||||
r.customHeaders["User-Agent"] = uarand.GetRandom()
|
||||
}
|
||||
|
||||
client, err := httpclientpool.Get(options.Options, &httpclientpool.Configuration{
|
||||
Threads: r.Threads,
|
||||
MaxRedirects: r.MaxRedirects,
|
||||
|
@ -103,6 +98,10 @@ func (r *Request) Compile(options *protocols.ExecuterOptions) error {
|
|||
}
|
||||
r.customHeaders[parts[0]] = strings.TrimSpace(parts[1])
|
||||
}
|
||||
// Add User-Agent value randomly to the customHeaders slice if `random-agent` flag is given
|
||||
if r.options.Options.RandomAgent {
|
||||
r.customHeaders["User-Agent"] = uarand.GetRandom()
|
||||
}
|
||||
|
||||
if r.Body != "" && !strings.Contains(r.Body, "\r\n") {
|
||||
r.Body = strings.ReplaceAll(r.Body, "\n", "\r\n")
|
||||
|
|
Loading…
Reference in New Issue