mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 17:25:28 +00:00
* fix url encoding issues * complete requested changes and improvements * fix missing issue-tracker-config.yaml * fuzz: deepcopy and use urlutil.Params
23 lines
589 B
Go
23 lines
589 B
Go
package fuzz
|
|
|
|
import (
|
|
"testing"
|
|
|
|
urlutil "github.com/projectdiscovery/utils/url"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestRuleIsExecutable(t *testing.T) {
|
|
rule := &Rule{Part: "query"}
|
|
err := rule.Compile(nil, nil)
|
|
require.NoError(t, err, "could not compile rule")
|
|
|
|
parsed, _ := urlutil.Parse("https://example.com/?url=localhost")
|
|
result := rule.isExecutable(parsed)
|
|
require.True(t, result, "could not get correct result")
|
|
|
|
parsed, _ = urlutil.Parse("https://example.com/")
|
|
result = rule.isExecutable(parsed)
|
|
require.False(t, result, "could not get correct result")
|
|
}
|