Skip to content

Commit

Permalink
Fixed a panic with traceLog and fixed a tengo bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ice3man543 committed Nov 12, 2020
1 parent 867364c commit 0a760a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions v2/internal/runner/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,14 @@ func (r *Runner) preloadWorkflowTemplates(p *progress.Progress, workflow *workfl
ProxySocksURL: r.options.ProxySocksURL,
CustomHeaders: r.options.CustomHeaders,
CookieJar: jar,
TraceLog: r.traceLog,
}
} else if len(t.RequestsDNS) > 0 {
template.DNSOptions = &executer.DNSOptions{
Debug: r.options.Debug,
Template: t,
Writer: r.output,
TraceLog: r.traceLog,
}
}
if template.DNSOptions != nil || template.HTTPOptions != nil {
Expand Down
4 changes: 2 additions & 2 deletions v2/pkg/workflows/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (w *Workflow) generateLogicFromWorkflows() error {
}

func (w *Workflow) generateTemplateFunc(template *WorkflowTemplate, workflowBuilder *strings.Builder) error {
ID := ksuid.New().String()
ID := "var_" + ksuid.New().String()
w.Variables[ID] = template.Template

if len(template.Subtemplates) > 0 && len(template.Matchers) > 0 {
Expand Down Expand Up @@ -69,7 +69,7 @@ func (w *Workflow) generateTemplateFunc(template *WorkflowTemplate, workflowBuil
}
if len(template.Matchers) == 0 && len(template.Subtemplates) == 0 {
workflowBuilder.WriteString(ID)
workflowBuilder.WriteString("()")
workflowBuilder.WriteString("();")
}
return nil
}

0 comments on commit 0a760a4

Please sign in to comment.