diff --git a/pkg/catalog/loader/loader.go b/pkg/catalog/loader/loader.go index 3c1e9bd195..ad6180da27 100644 --- a/pkg/catalog/loader/loader.go +++ b/pkg/catalog/loader/loader.go @@ -298,6 +298,27 @@ func (store *Store) LoadTemplatesOnlyMetadata() error { for templatePath := range validPaths { template, _, _ := templatesCache.Has(templatePath) + + if len(template.RequestsHeadless) > 0 && !store.config.ExecutorOptions.Options.Headless { + continue + } + + if len(template.RequestsCode) > 0 && !store.config.ExecutorOptions.Options.EnableCodeTemplates { + continue + } + + if template.IsFuzzing() && !store.config.ExecutorOptions.Options.DAST { + continue + } + + if template.SelfContained && !store.config.ExecutorOptions.Options.EnableSelfContainedTemplates { + continue + } + + if template.HasFileProtocol() && !store.config.ExecutorOptions.Options.EnableFileTemplates { + continue + } + if template != nil { template.Path = templatePath store.templates = append(store.templates, template)