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) r.setCustomHeaders(request)
var ( var (
resp *http.Response resp *http.Response
fromcache bool 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 { // For race conditions we can't dump the request body at this point as it's already waiting the open-gate event
gologger.Info().Msgf("[%s] Dumped HTTP request for %s\n\n", r.options.TemplateID, reqURL) if !request.original.Race {
gologger.Print().Msgf("%s", string(dumpedRequest)) 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 var formedURL string