use request numbering as per template definition in req-condition (#2135)

* use original request number instead of current iteration in request-condition

* add previousEvent tracking back for request condition

Co-authored-by: sandeep <sandeep@projectdiscovery.io>
dev
Sajad 2022-06-11 14:29:05 +05:30 committed by GitHub
parent e575f53be7
commit e7591ec8b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -240,7 +240,6 @@ func (request *Request) ExecuteWithResults(reqURL string, dynamicValues, previou
generator := request.newGenerator() generator := request.newGenerator()
var gotDynamicValues map[string][]string var gotDynamicValues map[string][]string
requestCount := 1
var requestErr error var requestErr error
for { for {
// returns two values, error and skip, which skips the execution for the request instance. // returns two values, error and skip, which skips the execution for the request instance.
@ -285,7 +284,7 @@ func (request *Request) ExecuteWithResults(reqURL string, dynamicValues, previou
} else { } else {
callback(event) callback(event)
} }
}, requestCount) }, generator.currentIndex)
// If a variable is unresolved, skip all further requests // If a variable is unresolved, skip all further requests
if err == errStopExecution { if err == errStopExecution {
@ -297,7 +296,6 @@ func (request *Request) ExecuteWithResults(reqURL string, dynamicValues, previou
} }
requestErr = err requestErr = err
} }
requestCount++
request.options.Progress.IncrementRequests() request.options.Progress.IncrementRequests()
// If this was a match, and we want to stop at first match, skip all further requests. // If this was a match, and we want to stop at first match, skip all further requests.