nuclei/v2/pkg/protocols/http/cluster_test.go

16 lines
409 B
Go

package http
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestCanCluster(t *testing.T) {
req := &Request{Unsafe: true}
require.False(t, req.CanCluster(&Request{}), "could cluster unsafe request")
req = &Request{Path: []string{"{{BaseURL}}"}, Method: "GET"}
require.True(t, req.CanCluster(&Request{Path: []string{"{{BaseURL}}"}, Method: "GET"}), "could not cluster GET request")
}