From d10dfb550e2f6a62ca246aea8eebd8596aa73c71 Mon Sep 17 00:00:00 2001 From: forgedhallpass <13679401+forgedhallpass@users.noreply.github.com> Date: Thu, 30 Sep 2021 19:07:59 +0300 Subject: [PATCH] Implicitly set the headless flag if template validation was requested, in order to correctly validate headless templates instead of complaining about "cannot create template executer" --- v2/internal/runner/options.go | 1 + v2/pkg/types/types.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/v2/internal/runner/options.go b/v2/internal/runner/options.go index cba1af5bf..eb57d94aa 100644 --- a/v2/internal/runner/options.go +++ b/v2/internal/runner/options.go @@ -95,6 +95,7 @@ func validateOptions(options *types.Options) error { } if options.Validate { + options.Headless = true // required for correct validation of headless templates validateTemplatePaths(options.TemplatesDirectory, options.Templates, options.Workflows) } diff --git a/v2/pkg/types/types.go b/v2/pkg/types/types.go index 5918ac41a..6e1b54565 100644 --- a/v2/pkg/types/types.go +++ b/v2/pkg/types/types.go @@ -103,7 +103,7 @@ type Options struct { Headless bool // ShowBrowser specifies whether the show the browser in headless mode ShowBrowser bool - // SytemResolvers enables override of nuclei's DNS client opting to use system resolver stack. + // SystemResolvers enables override of nuclei's DNS client opting to use system resolver stack. SystemResolvers bool // Metrics enables display of metrics via an http endpoint Metrics bool