mirror of https://github.com/daffainfo/nuclei.git
added validation for headless templates (#2423)
* added validation for headless templates * minor update in log msgdev
parent
9e531727a7
commit
d14c00fc6f
|
@ -267,7 +267,11 @@ func (store *Store) LoadTemplates(templatesList []string) []*templates.Template
|
|||
stats.Increment(parsers.RuntimeWarningsStats)
|
||||
gologger.Warning().Msgf("Could not parse template %s: %s\n", templatePath, err)
|
||||
} else if parsed != nil {
|
||||
loadedTemplates = append(loadedTemplates, parsed)
|
||||
if len(parsed.RequestsHeadless) > 0 && !store.config.ExecutorOptions.Options.Headless {
|
||||
gologger.Warning().Msgf("Headless flag is required for headless template %s\n", templatePath)
|
||||
} else {
|
||||
loadedTemplates = append(loadedTemplates, parsed)
|
||||
}
|
||||
}
|
||||
} else if err != nil {
|
||||
gologger.Warning().Msgf("Could not load template %s: %s\n", templatePath, err)
|
||||
|
@ -314,7 +318,11 @@ func (store *Store) LoadTemplatesWithTags(templatesList, tags []string) []*templ
|
|||
stats.Increment(parsers.RuntimeWarningsStats)
|
||||
gologger.Warning().Msgf("Could not parse template %s: %s\n", templatePath, err)
|
||||
} else if parsed != nil {
|
||||
loadedTemplates = append(loadedTemplates, parsed)
|
||||
if len(parsed.RequestsHeadless) > 0 && !store.config.ExecutorOptions.Options.Headless {
|
||||
gologger.Warning().Msgf("Headless flag is required for headless template %s\n", templatePath)
|
||||
} else {
|
||||
loadedTemplates = append(loadedTemplates, parsed)
|
||||
}
|
||||
}
|
||||
} else if err != nil {
|
||||
gologger.Warning().Msgf("Could not load template %s: %s\n", templatePath, err)
|
||||
|
|
Loading…
Reference in New Issue