Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/protocols/http/cluster_test.go
2070 views
1
package http
2
3
import (
4
"testing"
5
6
"github.com/stretchr/testify/require"
7
)
8
9
func TestCanCluster(t *testing.T) {
10
req := &Request{Unsafe: true}
11
require.False(t, req.IsClusterable(), "could cluster unsafe request")
12
13
req = &Request{Path: []string{"{{BaseURL}}"}, Method: HTTPMethodTypeHolder{MethodType: HTTPGet}}
14
newReq := &Request{Path: []string{"{{BaseURL}}"}, Method: HTTPMethodTypeHolder{MethodType: HTTPGet}}
15
require.True(t, req.IsClusterable(), "could not cluster GET request")
16
require.True(t, req.IsClusterable(), "could not cluster GET request")
17
require.Equal(t, req.TmplClusterKey(), newReq.TmplClusterKey(), "cluster keys should be equal")
18
}
19
20