mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 21:15:26 +00:00
add utm_source in uc (#4112)
This commit is contained in:
parent
680fc5574b
commit
9364bec8d9
@ -6,6 +6,6 @@ import osutils "github.com/projectdiscovery/utils/os"
|
||||
var interactshTestCases = []TestCaseInfo{
|
||||
{Path: "http/interactsh.yaml", TestCase: &httpInteractshRequest{}, DisableOn: func() bool { return osutils.IsWindows() || osutils.IsOSX() }},
|
||||
{Path: "http/interactsh-stop-at-first-match.yaml", TestCase: &httpInteractshStopAtFirstMatchRequest{}, DisableOn: func() bool { return osutils.IsWindows() || osutils.IsOSX() }},
|
||||
{Path: "http/default-matcher-condition.yaml", TestCase: &httpDefaultMatcherCondition{}, DisableOn: func() bool { return osutils.IsWindows() || osutils.IsOSX() }},
|
||||
{Path: "http/default-matcher-condition.yaml", TestCase: &httpDefaultMatcherCondition{}, DisableOn: func() bool { return true }}, // disable this test for now
|
||||
{Path: "http/interactsh-requests-mc-and.yaml", TestCase: &httpInteractshRequestsWithMCAnd{}},
|
||||
}
|
||||
|
||||
@ -103,3 +103,29 @@ func isEmptyDir(dir string) bool {
|
||||
})
|
||||
return !hasFiles
|
||||
}
|
||||
|
||||
// getUtmSource returns utm_source from environment variable
|
||||
func getUtmSource() string {
|
||||
value := ""
|
||||
switch {
|
||||
case os.Getenv("GH_ACTION") != "":
|
||||
value = "ghci"
|
||||
case os.Getenv("TRAVIS") != "":
|
||||
value = "travis"
|
||||
case os.Getenv("CIRCLECI") != "":
|
||||
value = "circleci"
|
||||
case os.Getenv("CI") != "":
|
||||
value = "gitlabci" // this also includes bitbucket
|
||||
case os.Getenv("GITHUB_ACTIONS") != "":
|
||||
value = "ghci"
|
||||
case os.Getenv("AWS_EXECUTION_ENV") != "":
|
||||
value = os.Getenv("AWS_EXECUTION_ENV")
|
||||
case os.Getenv("JENKINS_URL") != "":
|
||||
value = "jenkins"
|
||||
case os.Getenv("FUNCTION_TARGET") != "":
|
||||
value = "gcf"
|
||||
default:
|
||||
value = "unknown"
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
@ -71,6 +71,7 @@ func getpdtmParams() string {
|
||||
params.Add("arch", runtime.GOARCH)
|
||||
params.Add("go_version", runtime.Version())
|
||||
params.Add("v", config.Version)
|
||||
params.Add("utm_source", getUtmSource())
|
||||
return params.Encode()
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user