mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 21:45:26 +00:00
fix(engine): Resolve issue with ExecuteWithResults function not returning expected results (#5376)
fix(engine): Resolve issue with ExecuteWithResults function not returning expected results When attempting to use the `ExecuteWithResults` function, users were finding that the function was not returning the expected results. This fix addresses the root cause of this problem.
This commit is contained in:
parent
3e1cd27943
commit
deb0dd2a5f
@ -27,7 +27,7 @@ func (e *Engine) executeAllSelfContained(ctx context.Context, alltemplates []*te
|
|||||||
var match bool
|
var match bool
|
||||||
ctx := scan.NewScanContext(ctx, contextargs.New(ctx))
|
ctx := scan.NewScanContext(ctx, contextargs.New(ctx))
|
||||||
if e.Callback != nil {
|
if e.Callback != nil {
|
||||||
if results, err := template.Executer.ExecuteWithResults(ctx); err != nil {
|
if results, err := template.Executer.ExecuteWithResults(ctx); err == nil {
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
e.Callback(result)
|
e.Callback(result)
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ func (e *Engine) executeTemplateWithTargets(ctx context.Context, template *templ
|
|||||||
match = e.executeWorkflow(ctx, template.CompiledWorkflow)
|
match = e.executeWorkflow(ctx, template.CompiledWorkflow)
|
||||||
default:
|
default:
|
||||||
if e.Callback != nil {
|
if e.Callback != nil {
|
||||||
if results, err := template.Executer.ExecuteWithResults(ctx); err != nil {
|
if results, err := template.Executer.ExecuteWithResults(ctx); err == nil {
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
e.Callback(result)
|
e.Callback(result)
|
||||||
}
|
}
|
||||||
@ -194,7 +194,7 @@ func (e *Engine) executeTemplatesOnTarget(ctx context.Context, alltemplates []*t
|
|||||||
match = e.executeWorkflow(ctx, template.CompiledWorkflow)
|
match = e.executeWorkflow(ctx, template.CompiledWorkflow)
|
||||||
default:
|
default:
|
||||||
if e.Callback != nil {
|
if e.Callback != nil {
|
||||||
if results, err := template.Executer.ExecuteWithResults(ctx); err != nil {
|
if results, err := template.Executer.ExecuteWithResults(ctx); err == nil {
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
e.Callback(result)
|
e.Callback(result)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user