Merge pull request #575 from projectdiscovery/bugfix-race-conditions

removing dump request for race conditions
dev
Ice3man 2021-02-25 13:15:58 +05:30 committed by GitHub
commit 22f04cae35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 9 deletions

View File

@ -211,17 +211,23 @@ func (r *Request) executeRequest(reqURL string, request *generatedRequest, dynam
r.setCustomHeaders(request)
var (
resp *http.Response
fromcache bool
resp *http.Response
fromcache bool
dumpedRequest []byte
err error
)
dumpedRequest, err := dump(request, reqURL)
if err != nil {
return err
}
if r.options.Options.Debug || r.options.Options.DebugRequests {
gologger.Info().Msgf("[%s] Dumped HTTP request for %s\n\n", r.options.TemplateID, reqURL)
gologger.Print().Msgf("%s", string(dumpedRequest))
// For race conditions we can't dump the request body at this point as it's already waiting the open-gate event
if !request.original.Race {
dumpedRequest, err = dump(request, reqURL)
if err != nil {
return err
}
if r.options.Options.Debug || r.options.Options.DebugRequests {
gologger.Info().Msgf("[%s] Dumped HTTP request for %s\n\n", r.options.TemplateID, reqURL)
gologger.Print().Msgf("%s", string(dumpedRequest))
}
}
var formedURL string