mirror of https://github.com/daffainfo/nuclei.git
Fixed file protocol bugs
parent
1cfc5ce6ef
commit
2717a8b647
|
@ -66,20 +66,20 @@ func (r *Request) Compile(options *protocols.ExecuterOptions) error {
|
|||
if extension == "all" {
|
||||
r.allExtensions = true
|
||||
} else {
|
||||
if strings.HasPrefix(extension, ".") {
|
||||
if !strings.HasPrefix(extension, ".") {
|
||||
extension = "." + extension
|
||||
}
|
||||
r.extensions[extension] = struct{}{}
|
||||
}
|
||||
}
|
||||
for _, extension := range defaultDenylist {
|
||||
if strings.HasPrefix(extension, ".") {
|
||||
if !strings.HasPrefix(extension, ".") {
|
||||
extension = "." + extension
|
||||
}
|
||||
r.extensionDenylist[extension] = struct{}{}
|
||||
}
|
||||
for _, extension := range r.ExtensionDenylist {
|
||||
if strings.HasPrefix(extension, ".") {
|
||||
if !strings.HasPrefix(extension, ".") {
|
||||
extension = "." + extension
|
||||
}
|
||||
r.extensionDenylist[extension] = struct{}{}
|
||||
|
|
|
@ -16,7 +16,7 @@ func TestFileCompile(t *testing.T) {
|
|||
ID: templateID,
|
||||
MaxSize: 1024,
|
||||
NoRecursive: false,
|
||||
Extensions: []string{"*", ".lock"},
|
||||
Extensions: []string{"all", ".lock"},
|
||||
ExtensionDenylist: []string{".go"},
|
||||
}
|
||||
executerOpts := testutils.NewMockExecuterOptions(options, &testutils.TemplateInfo{
|
||||
|
|
|
@ -19,7 +19,7 @@ func TestFindInputPaths(t *testing.T) {
|
|||
ID: templateID,
|
||||
MaxSize: 1024,
|
||||
NoRecursive: false,
|
||||
Extensions: []string{"*", ".lock"},
|
||||
Extensions: []string{"all", ".lock"},
|
||||
ExtensionDenylist: []string{".go"},
|
||||
}
|
||||
executerOpts := testutils.NewMockExecuterOptions(options, &testutils.TemplateInfo{
|
||||
|
|
|
@ -23,7 +23,7 @@ func TestFileExecuteWithResults(t *testing.T) {
|
|||
ID: templateID,
|
||||
MaxSize: 1024,
|
||||
NoRecursive: false,
|
||||
Extensions: []string{"*"},
|
||||
Extensions: []string{"all"},
|
||||
ExtensionDenylist: []string{".go"},
|
||||
Operators: operators.Operators{
|
||||
Matchers: []*matchers.Matcher{{
|
||||
|
|
Loading…
Reference in New Issue