mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 21:45:26 +00:00
* Clustering performance improvements * IsClusterable filters out beforehand, update test to mirror that * inverse IsClusterable This makes much more sense * HashMap based clustering * furthur improvements to clustering --------- Co-authored-by: Tarun Koyalwar <tarun@projectdiscovery.io>
19 lines
657 B
Go
19 lines
657 B
Go
package http
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestCanCluster(t *testing.T) {
|
|
req := &Request{Unsafe: true}
|
|
require.False(t, req.IsClusterable(), "could cluster unsafe request")
|
|
|
|
req = &Request{Path: []string{"{{BaseURL}}"}, Method: HTTPMethodTypeHolder{MethodType: HTTPGet}}
|
|
newReq := &Request{Path: []string{"{{BaseURL}}"}, Method: HTTPMethodTypeHolder{MethodType: HTTPGet}}
|
|
require.True(t, req.IsClusterable(), "could not cluster GET request")
|
|
require.True(t, req.IsClusterable(), "could not cluster GET request")
|
|
require.Equal(t, req.TmplClusterKey(), newReq.TmplClusterKey(), "cluster keys should be equal")
|
|
}
|