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

@ -213,8 +213,13 @@ func (r *Request) executeRequest(reqURL string, request *generatedRequest, dynam
var ( var (
resp *http.Response resp *http.Response
fromcache bool fromcache bool
dumpedRequest []byte
err error
) )
dumpedRequest, err := dump(request, reqURL)
// 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 { if err != nil {
return err return err
} }
@ -223,6 +228,7 @@ func (r *Request) executeRequest(reqURL string, request *generatedRequest, dynam
gologger.Info().Msgf("[%s] Dumped HTTP request for %s\n\n", r.options.TemplateID, reqURL) gologger.Info().Msgf("[%s] Dumped HTTP request for %s\n\n", r.options.TemplateID, reqURL)
gologger.Print().Msgf("%s", string(dumpedRequest)) gologger.Print().Msgf("%s", string(dumpedRequest))
} }
}
var formedURL string var formedURL string
var hostname string var hostname string