mirror of https://github.com/daffainfo/nuclei.git
Merge pull request #975 from projectdiscovery/stop-at-first-match
Stop at first match support for HTTP requestsdev
commit
bd722c2474
|
@ -161,6 +161,9 @@ type Request struct {
|
|||
//
|
||||
// This allows matching on them later for multi-request conditions.
|
||||
ReqCondition bool `yaml:"req-condition,omitempty" jsonschema:"title=preserve request history,description=Automatically assigns numbers to requests and preserves their history"`
|
||||
// description: |
|
||||
// StopAtFirstMatch stops the execution of the requests as soon as a match is found.
|
||||
StopAtFirstMatch bool `yaml:"stop-at-first-match,omitempty" jsonschema:"title=stop at first match,description=Stop the execution after a match is found"`
|
||||
}
|
||||
|
||||
// GetID returns the unique ID of the request if any.
|
||||
|
|
|
@ -249,7 +249,7 @@ func (r *Request) ExecuteWithResults(reqURL string, dynamicValues, previous outp
|
|||
requestCount++
|
||||
r.options.Progress.IncrementRequests()
|
||||
|
||||
if request.original.options.Options.StopAtFirstMatch && gotOutput {
|
||||
if (request.original.options.Options.StopAtFirstMatch || r.StopAtFirstMatch) && gotOutput {
|
||||
r.options.Progress.IncrementErrorsBy(int64(generator.Total()))
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue