mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 17:35:26 +00:00
* chore: fix non-constant fmt string in call Signed-off-by: Dwi Siswanto <git@dw1.io> * build: bump all direct modules Signed-off-by: Dwi Siswanto <git@dw1.io> * chore(hosterrorscache): update import path Signed-off-by: Dwi Siswanto <git@dw1.io> * fix(charts): break changes Signed-off-by: Dwi Siswanto <git@dw1.io> * build: pinned `github.com/zmap/zcrypto` to v0.0.0-20240512203510-0fef58d9a9db Signed-off-by: Dwi Siswanto <git@dw1.io> * chore: golangci-lint auto fixes Signed-off-by: Dwi Siswanto <git@dw1.io> * chore: satisfy lints Signed-off-by: Dwi Siswanto <git@dw1.io> * build: migrate `github.com/xanzy/go-gitlab` => `gitlab.com/gitlab-org/api/client-go` Signed-off-by: Dwi Siswanto <git@dw1.io> * feat(json): update build constraints Signed-off-by: Dwi Siswanto <git@dw1.io> * chore: dont panicking on close err Signed-off-by: Dwi Siswanto <git@dw1.io> --------- Signed-off-by: Dwi Siswanto <git@dw1.io>
22 lines
818 B
Go
22 lines
818 B
Go
package http
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/cespare/xxhash"
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/utils"
|
|
)
|
|
|
|
// TmplClusterKey generates a unique key for the request
|
|
// to be used in the clustering process.
|
|
func (request *Request) TmplClusterKey() uint64 {
|
|
inp := fmt.Sprintf("%s-%d-%t-%t-%s-%d", request.Method.String(), request.MaxRedirects, request.DisableCookie, request.Redirects, strings.Join(request.Path, "-"), utils.MapHash(request.Headers))
|
|
return xxhash.Sum64String(inp)
|
|
}
|
|
|
|
// IsClusterable returns true if the request is eligible to be clustered.
|
|
func (request *Request) IsClusterable() bool {
|
|
return len(request.Payloads) <= 0 && len(request.Fuzzing) <= 0 && len(request.Raw) <= 0 && len(request.Body) <= 0 && !request.Unsafe && !request.NeedsRequestCondition() && request.Name == ""
|
|
}
|