mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 06:25:29 +00:00
feat(config): adds known misc directories
and excludes em in IsTemplate func. Signed-off-by: Dwi Siswanto <git@dw1.io>
This commit is contained in:
parent
95a72cfd50
commit
7d450507f7
@ -12,7 +12,10 @@ import (
|
|||||||
stringsutil "github.com/projectdiscovery/utils/strings"
|
stringsutil "github.com/projectdiscovery/utils/strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var knownConfigFiles = []string{"cves.json", "contributors.json", "TEMPLATES-STATS.json"}
|
var (
|
||||||
|
knownConfigFiles = []string{"cves.json", "contributors.json", "TEMPLATES-STATS.json"}
|
||||||
|
knownMiscDirectories = []string{".git/", ".github/", "helpers/"}
|
||||||
|
)
|
||||||
|
|
||||||
// TemplateFormat
|
// TemplateFormat
|
||||||
type TemplateFormat uint8
|
type TemplateFormat uint8
|
||||||
@ -47,6 +50,11 @@ func IsTemplate(filename string) bool {
|
|||||||
if stringsutil.ContainsAny(filename, knownConfigFiles...) {
|
if stringsutil.ContainsAny(filename, knownConfigFiles...) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if stringsutil.ContainsAny(filename, knownMiscDirectories...) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return stringsutil.EqualFoldAny(filepath.Ext(filename), GetSupportTemplateFileExtensions()...)
|
return stringsutil.EqualFoldAny(filepath.Ext(filename), GetSupportTemplateFileExtensions()...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user