Merge pull request #255 from vzamanillo/colorizer-fix

Colorizer initialization when using a custom workflow
dev
bauthard 2020-08-24 23:02:16 +05:30 committed by GitHub
commit 3a7379dbd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"sync"
tengo "github.com/d5/tengo/v2"
"github.com/logrusorgru/aurora"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/nuclei/v2/internal/progress"
"github.com/projectdiscovery/nuclei/v2/pkg/atomicboolean"
@ -64,6 +65,9 @@ func (n *NucleiVar) Call(args ...tengo.Object) (ret tengo.Object, err error) {
// apply externally supplied payloads if any
request.Payloads = generators.MergeMaps(request.Payloads, externalVars)
template.HTTPOptions.BulkHttpRequest = request
if template.HTTPOptions.Colorizer == nil {
template.HTTPOptions.Colorizer = aurora.NewAurora(true)
}
httpExecuter, err := executer.NewHTTPExecuter(template.HTTPOptions)
if err != nil {
p.Drop(request.GetRequestCount())