Skip to content

Find, verify, and analyze leaked credentials

Add context timeout to scanners

Dustin Decker79496b81427a
diff --git a/pkg/detectors/abbysale/abbysale.go b/pkg/detectors/abbysale/abbysale.go
index 8f0575053..7923297bc 100644
--- a/pkg/detectors/abbysale/abbysale.go
+++ b/pkg/detectors/abbysale/abbysale.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.abyssale.com/ready", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.abyssale.com/ready", nil)
req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/abstract/abstract.go b/pkg/detectors/abstract/abstract.go
index d7216eff4..5fa627da0 100644
--- a/pkg/detectors/abstract/abstract.go
+++ b/pkg/detectors/abstract/abstract.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://exchange-rates.abstractapi.com/v1/live/?api_key=%s&base=USD", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://exchange-rates.abstractapi.com/v1/live/?api_key=%s&base=USD", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/abuseipdb/abuseipdb.go b/pkg/detectors/abuseipdb/abuseipdb.go
index e2c05abbc..7e3c347a0 100644
--- a/pkg/detectors/abuseipdb/abuseipdb.go
+++ b/pkg/detectors/abuseipdb/abuseipdb.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.abuseipdb.com/api/v2/check?ipAddress=118.25.6.39", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.abuseipdb.com/api/v2/check?ipAddress=118.25.6.39", nil)
req.Header.Add("Key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/accuweather/accuweather.go b/pkg/detectors/accuweather/accuweather.go
index ded2fc81d..c0fd0516b 100644
--- a/pkg/detectors/accuweather/accuweather.go
+++ b/pkg/detectors/accuweather/accuweather.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "http://dataservice.accuweather.com/locations/v1/cities/autocomplete?apikey="+resMatch+"&q=----&language=en-us", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "http://dataservice.accuweather.com/locations/v1/cities/autocomplete?apikey="+resMatch+"&q=----&language=en-us", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/adafruitio/adafruitio.go b/pkg/detectors/adafruitio/adafruitio.go
index a064ab202..2f066edc8 100644
--- a/pkg/detectors/adafruitio/adafruitio.go
+++ b/pkg/detectors/adafruitio/adafruitio.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://io.adafruit.com/api/v2/ladybugtest/feeds/?x-aio-key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://io.adafruit.com/api/v2/ladybugtest/feeds/?x-aio-key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/adobeio/adobeio.go b/pkg/detectors/adobeio/adobeio.go
index d254c8786..d530db0ff 100644
--- a/pkg/detectors/adobeio/adobeio.go
+++ b/pkg/detectors/adobeio/adobeio.go
@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://stock.adobe.io/Rest/Media/1/Search/Files?locale=en_US%2526search_parameters%255Bwords%255D=kittens", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://stock.adobe.io/Rest/Media/1/Search/Files?locale=en_US%2526search_parameters%255Bwords%255D=kittens", nil)
req.Header.Add("x-api-key", resMatch)
req.Header.Add("x-product", resIdMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/adzuna/adzuna.go b/pkg/detectors/adzuna/adzuna.go
index f4e539793..6a1de3d23 100644
--- a/pkg/detectors/adzuna/adzuna.go
+++ b/pkg/detectors/adzuna/adzuna.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.adzuna.com/v1/api/jobs/gb/search/1?app_id=%s&app_key=%s", resIdMatch, resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.adzuna.com/v1/api/jobs/gb/search/1?app_id=%s&app_key=%s", resIdMatch, resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/agora/agora.go b/pkg/detectors/agora/agora.go
index 1c6054d99..7d4840b76 100644
--- a/pkg/detectors/agora/agora.go
+++ b/pkg/detectors/agora/agora.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.agora.io/dev/v1/projects", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.agora.io/dev/v1/projects", nil)
req.SetBasicAuth(resSecret, resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go b/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go
index 8f536dd96..6d5eb47b1 100644
--- a/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go
+++ b/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go
@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"environment":"production","username":"john","email":"[email protected]","repository":"https://github.com/airbrake/airbrake","revision":"38748467ea579e7ae64f7815452307c9d05e05c5","version":"v2.0"}`)
- req, _ := http.NewRequest("POST", "https://api.airbrake.io/api/v4/projects/"+resIdMatch+"/deploys?key="+resMatch, payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.airbrake.io/api/v4/projects/"+resIdMatch+"/deploys?key="+resMatch, payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go b/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go
index 5ba945198..7221e7eb2 100644
--- a/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go
+++ b/pkg/detectors/airbrakeuserkey/airbrakeuserkey.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.airbrake.io/api/v4/projects?key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.airbrake.io/api/v4/projects?key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/airship/airship.go b/pkg/detectors/airship/airship.go
index 9d81e7e25..5ecfccd7b 100644
--- a/pkg/detectors/airship/airship.go
+++ b/pkg/detectors/airship/airship.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://go.urbanairship.com/api/schedules", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://go.urbanairship.com/api/schedules", nil)
req.Header.Add("Accept", "application/vnd.urbanairship+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/airtableapikey/airtableapikey.go b/pkg/detectors/airtableapikey/airtableapikey.go
index f7751f7b0..698f46d79 100644
--- a/pkg/detectors/airtableapikey/airtableapikey.go
+++ b/pkg/detectors/airtableapikey/airtableapikey.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.airtable.com/v0/"+appRes+"/Projects", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.airtable.com/v0/"+appRes+"/Projects", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", keyRes))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/airvisual/airvisual.go b/pkg/detectors/airvisual/airvisual.go
index e509eb324..80fe09ada 100644
--- a/pkg/detectors/airvisual/airvisual.go
+++ b/pkg/detectors/airvisual/airvisual.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.airvisual.com/v2/countries?key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.airvisual.com/v2/countries?key=%s", resMatch), nil)
req.Header.Add("Accept", "application/vnd.airvisual+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/alconost/alconost.go b/pkg/detectors/alconost/alconost.go
index 7da2ee13e..1b3342e36 100644
--- a/pkg/detectors/alconost/alconost.go
+++ b/pkg/detectors/alconost/alconost.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://nitro.alconost.com/api/v1/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://nitro.alconost.com/api/v1/account", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/alegra/alegra.go b/pkg/detectors/alegra/alegra.go
index 1aa765c9d..3320a738f 100644
--- a/pkg/detectors/alegra/alegra.go
+++ b/pkg/detectors/alegra/alegra.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.alegra.com/api/v1/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.alegra.com/api/v1/users", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/aletheiaapi/aletheiaapi.go b/pkg/detectors/aletheiaapi/aletheiaapi.go
index a367665f5..1585e3151 100644
--- a/pkg/detectors/aletheiaapi/aletheiaapi.go
+++ b/pkg/detectors/aletheiaapi/aletheiaapi.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", "https://api.aletheiaapi.com/StockData?symbol=msft&summary=true", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.aletheiaapi.com/StockData?symbol=msft&summary=true", nil)
req.Header.Add("Key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/algoliaadminkey/algoliaadminkey.go b/pkg/detectors/algoliaadminkey/algoliaadminkey.go
index fd7c079ab..43d29445d 100644
--- a/pkg/detectors/algoliaadminkey/algoliaadminkey.go
+++ b/pkg/detectors/algoliaadminkey/algoliaadminkey.go
@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://"+resIdMatch+"-dsn.algolia.net/1/keys", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://"+resIdMatch+"-dsn.algolia.net/1/keys", nil)
req.Header.Add("X-Algolia-Application-Id", resIdMatch)
req.Header.Add("X-Algolia-API-Key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/alienvault/alienvault.go b/pkg/detectors/alienvault/alienvault.go
index 092db305a..2d2658a7f 100644
--- a/pkg/detectors/alienvault/alienvault.go
+++ b/pkg/detectors/alienvault/alienvault.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://otx.alienvault.com/api/v1/users/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://otx.alienvault.com/api/v1/users/me", nil)
req.Header.Add("X-OTX-API-KEY", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/allsports/allsports.go b/pkg/detectors/allsports/allsports.go
index 37727bd6a..1328bf246 100644
--- a/pkg/detectors/allsports/allsports.go
+++ b/pkg/detectors/allsports/allsports.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://apiv2.allsportsapi.com/football/?met=Countries&APIkey="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://apiv2.allsportsapi.com/football/?met=Countries&APIkey="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/amadeus/amadeus.go b/pkg/detectors/amadeus/amadeus.go
index 450b03ac2..1e36da826 100644
--- a/pkg/detectors/amadeus/amadeus.go
+++ b/pkg/detectors/amadeus/amadeus.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader("grant_type=client_credentials&client_id=" + resMatch + "&client_secret=" + resSecret)
- req, _ := http.NewRequest("POST", "https://test.api.amadeus.com/v1/security/oauth2/token", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://test.api.amadeus.com/v1/security/oauth2/token", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/ambee/ambee.go b/pkg/detectors/ambee/ambee.go
index cf1c6bccd..291884793 100644
--- a/pkg/detectors/ambee/ambee.go
+++ b/pkg/detectors/ambee/ambee.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.ambeedata.com/latest/by-lat-lng?lat=12&lng=77", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.ambeedata.com/latest/by-lat-lng?lat=12&lng=77", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/amplitudeapikey/amplitudeapikey.go b/pkg/detectors/amplitudeapikey/amplitudeapikey.go
index 4a2da41b4..9623050c9 100644
--- a/pkg/detectors/amplitudeapikey/amplitudeapikey.go
+++ b/pkg/detectors/amplitudeapikey/amplitudeapikey.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader("api_key=" + resMatch + "&identification=%5B%7B%22user_id%22%3A%22datamonster%40gmail.com%22%2C%20%22user_properties%22%3A%7B%22Age%22%3A%2235%22%7D%2C%20%22groups%22%3A%7B%22company_id%22%3A%221234%22%7D%2C%20%22country%22%3A%22United%20States%22%7D%5D")
- req, _ := http.NewRequest("POST", "https://api.amplitude.com/identify", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.amplitude.com/identify", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/anypoint/anypoint.go b/pkg/detectors/anypoint/anypoint.go
index ea48c7b97..f0a5f2aac 100644
--- a/pkg/detectors/anypoint/anypoint.go
+++ b/pkg/detectors/anypoint/anypoint.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://anypoint.mulesoft.com/apiplatform/repository/v2/organizations/%s/apis/by-name?apiName=%s", orgRes, ""), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://anypoint.mulesoft.com/apiplatform/repository/v2/organizations/%s/apis/by-name?apiName=%s", orgRes, ""), nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/apacta/apacta.go b/pkg/detectors/apacta/apacta.go
index ee6025e77..0465996a0 100644
--- a/pkg/detectors/apacta/apacta.go
+++ b/pkg/detectors/apacta/apacta.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://app.apacta.com/api/v1/time_entries?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://app.apacta.com/api/v1/time_entries?api_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/api2cart/api2cart.go b/pkg/detectors/api2cart/api2cart.go
index 560fc78a8..d76ac176c 100644
--- a/pkg/detectors/api2cart/api2cart.go
+++ b/pkg/detectors/api2cart/api2cart.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.api2cart.com/v1.1/account.cart.list.json?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.api2cart.com/v1.1/account.cart.list.json?api_key=%s", resMatch), nil)
req.Header.Add("Accept", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/apideck/apideck.go b/pkg/detectors/apideck/apideck.go
index b840ac762..9795d766b 100644
--- a/pkg/detectors/apideck/apideck.go
+++ b/pkg/detectors/apideck/apideck.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://unify.apideck.com/vault/consumers", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://unify.apideck.com/vault/consumers", nil)
req.Header.Add("x-apideck-app-id", resIdMatch)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/apiflash/apiflash.go b/pkg/detectors/apiflash/apiflash.go
index 187926de6..4edffc9b6 100644
--- a/pkg/detectors/apiflash/apiflash.go
+++ b/pkg/detectors/apiflash/apiflash.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.apiflash.com/v1/urltoimage?url=%s&access_key=%s", resUrlMatch, resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.apiflash.com/v1/urltoimage?url=%s&access_key=%s", resUrlMatch, resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/apifonica/apifonica.go b/pkg/detectors/apifonica/apifonica.go
index 880934914..29492fe65 100644
--- a/pkg/detectors/apifonica/apifonica.go
+++ b/pkg/detectors/apifonica/apifonica.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", resMatch, resToken)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.apifonica.com/v2/accounts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.apifonica.com/v2/accounts", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/apify/apify.go b/pkg/detectors/apify/apify.go
index 7abb95843..8155a8e0b 100644
--- a/pkg/detectors/apify/apify.go
+++ b/pkg/detectors/apify/apify.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.apify.com/v2/acts?token="+resMatch+"&my=true&offset=10&limit=99&desc=true", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.apify.com/v2/acts?token="+resMatch+"&my=true&offset=10&limit=99&desc=true", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/apimatic/apimatic.go b/pkg/detectors/apimatic/apimatic.go
index a92b76ab4..51aa91be3 100644
--- a/pkg/detectors/apimatic/apimatic.go
+++ b/pkg/detectors/apimatic/apimatic.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", "https://www.apimatic.io/api/code-generations", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.apimatic.io/api/code-generations", nil)
req.SetBasicAuth(userPatMatch, passPatMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/apiscience/apiscience.go b/pkg/detectors/apiscience/apiscience.go
index 57411db76..0aa15f8aa 100644
--- a/pkg/detectors/apiscience/apiscience.go
+++ b/pkg/detectors/apiscience/apiscience.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.apiscience.com/v1/monitors", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.apiscience.com/v1/monitors", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/apollo/apollo.go b/pkg/detectors/apollo/apollo.go
index 776435cea..50f409053 100644
--- a/pkg/detectors/apollo/apollo.go
+++ b/pkg/detectors/apollo/apollo.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.apollo.io/v1/account_stages?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.apollo.io/v1/account_stages?api_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/appcues/appcues.go b/pkg/detectors/appcues/appcues.go
index 4696f56ab..e3757e06f 100644
--- a/pkg/detectors/appcues/appcues.go
+++ b/pkg/detectors/appcues/appcues.go
@@ -68,7 +68,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(resMatch),
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.appcues.com/v2/accounts/%s/flows", resIdMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.appcues.com/v2/accounts/%s/flows", resIdMatch), nil)
req.SetBasicAuth(resUserMatch, resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/appfollow/appfollow.go b/pkg/detectors/appfollow/appfollow.go
index 318cbadf4..4ee06499b 100644
--- a/pkg/detectors/appfollow/appfollow.go
+++ b/pkg/detectors/appfollow/appfollow.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.appfollow.io/test", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.appfollow.io/test", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/appsynergy/appsynergy.go b/pkg/detectors/appsynergy/appsynergy.go
index dc838fabf..36bd0d30d 100644
--- a/pkg/detectors/appsynergy/appsynergy.go
+++ b/pkg/detectors/appsynergy/appsynergy.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"html":"<html><body><h1>Hello World</h1></body></html>","filename":"HelloWorld.pdf"}`)
- req, _ := http.NewRequest("POST", fmt.Sprintf("https://www.appsynergy.com/api?action=HTML2PDF&apiKey=%s", resMatch), payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", fmt.Sprintf("https://www.appsynergy.com/api?action=HTML2PDF&apiKey=%s", resMatch), payload)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/apptivo/apptivo.go b/pkg/detectors/apptivo/apptivo.go
index 15c47f8ca..bd1c27bc4 100644
--- a/pkg/detectors/apptivo/apptivo.go
+++ b/pkg/detectors/apptivo/apptivo.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.apptivo.com/app/dao/v6/leads?a=getConfigData&apiKey=%s&accessKey=%s", resMatch, resIdMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.apptivo.com/app/dao/v6/leads?a=getConfigData&apiKey=%s&accessKey=%s", resMatch, resIdMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/artifactory/artifactory.go b/pkg/detectors/artifactory/artifactory.go
index 9cc969399..776291093 100644
--- a/pkg/detectors/artifactory/artifactory.go
+++ b/pkg/detectors/artifactory/artifactory.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://"+resURLMatch+"/artifactory/api/storageinfo", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://"+resURLMatch+"/artifactory/api/storageinfo", nil)
req.Header.Add("X-JFrog-Art-Api", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/artsy/artsy.go b/pkg/detectors/artsy/artsy.go
index c6090fd32..aedc29443 100644
--- a/pkg/detectors/artsy/artsy.go
+++ b/pkg/detectors/artsy/artsy.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("POST", "https://api.artsy.net/api/tokens/xapp_token?client_id="+resIdMatch+"&client_secret="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.artsy.net/api/tokens/xapp_token?client_id="+resIdMatch+"&client_secret="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/asanaoauth/asanaoauth.go b/pkg/detectors/asanaoauth/asanaoauth.go
index eb25bc6df..585c5ebb5 100644
--- a/pkg/detectors/asanaoauth/asanaoauth.go
+++ b/pkg/detectors/asanaoauth/asanaoauth.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.asana.com/api/1.0/users/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.asana.com/api/1.0/users/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go b/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go
index e06aeb01f..24017460b 100644
--- a/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go
+++ b/pkg/detectors/asanapersonalaccesstoken/asanapersonalaccesstoken.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.asana.com/api/1.0/users/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.asana.com/api/1.0/users/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/assemblyai/assemblyai.go b/pkg/detectors/assemblyai/assemblyai.go
index c5ea07898..9f728ad46 100644
--- a/pkg/detectors/assemblyai/assemblyai.go
+++ b/pkg/detectors/assemblyai/assemblyai.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.assemblyai.com/v2/transcript", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.assemblyai.com/v2/transcript", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/audd/audd.go b/pkg/detectors/audd/audd.go
index c3c0ab906..4837308b0 100644
--- a/pkg/detectors/audd/audd.go
+++ b/pkg/detectors/audd/audd.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.audd.io/setCallbackUrl/?api_token=%s&url=https://yourwebsite.com/callbacks_handler/", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.audd.io/setCallbackUrl/?api_token=%s&url=https://yourwebsite.com/callbacks_handler/", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go b/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go
index f892aaebf..c6303a62c 100644
--- a/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go
+++ b/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go
@@ -68,7 +68,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
curl -H "Authorization: Bearer $token" https://domain/api/v2/users
*/
- req, _ := http.NewRequest("GET", "https://"+domainRes+"/api/v2/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://"+domainRes+"/api/v2/users", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", managementApiTokenRes))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/auth0oauth/auth0oauth.go b/pkg/detectors/auth0oauth/auth0oauth.go
index d287f14e5..782ab3325 100644
--- a/pkg/detectors/auth0oauth/auth0oauth.go
+++ b/pkg/detectors/auth0oauth/auth0oauth.go
@@ -82,7 +82,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data.Set("code", "AUTHORIZATION_CODE")
data.Set("redirect_uri", "undefined")
- req, _ := http.NewRequest(http.MethodPost, "https://"+domainRes+"/oauth/token", strings.NewReader(data.Encode())) // URL-encoded payload
+ req, _ := http.NewRequestWithContext(ctx, http.MethodPost, "https://"+domainRes+"/oauth/token", strings.NewReader(data.Encode())) // URL-encoded payload
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/autodesk/autodesk.go b/pkg/detectors/autodesk/autodesk.go
index 0c7600fb8..abf72c04f 100644
--- a/pkg/detectors/autodesk/autodesk.go
+++ b/pkg/detectors/autodesk/autodesk.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(fmt.Sprintf(`grant_type=client_credentials&client_id=%s&client_secret=%s`, resMatch, resSecret))
- req, _ := http.NewRequest("POST", "https://developer.api.autodesk.com/authentication/v1/authenticate", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://developer.api.autodesk.com/authentication/v1/authenticate", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/autoklose/autoklose.go b/pkg/detectors/autoklose/autoklose.go
index 3b31c999c..1753a4c57 100644
--- a/pkg/detectors/autoklose/autoklose.go
+++ b/pkg/detectors/autoklose/autoklose.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.autoklose.com/api/campaigns/?api_token=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.autoklose.com/api/campaigns/?api_token=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/autopilot/autopilot.go b/pkg/detectors/autopilot/autopilot.go
index f4adccccb..d98306ae6 100644
--- a/pkg/detectors/autopilot/autopilot.go
+++ b/pkg/detectors/autopilot/autopilot.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api2.autopilothq.com/v1/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api2.autopilothq.com/v1/account", nil)
req.Header.Add("autopilotapikey", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/aviationstack/aviationstack.go b/pkg/detectors/aviationstack/aviationstack.go
index f1fcc40c5..a2c205a54 100644
--- a/pkg/detectors/aviationstack/aviationstack.go
+++ b/pkg/detectors/aviationstack/aviationstack.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.aviationstack.com/v1/flights?access_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.aviationstack.com/v1/flights?access_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/axonaut/axonaut.go b/pkg/detectors/axonaut/axonaut.go
index fef4d9e13..19d6fe52f 100644
--- a/pkg/detectors/axonaut/axonaut.go
+++ b/pkg/detectors/axonaut/axonaut.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://axonaut.com/api/v2/companies?type=all&sort=id", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://axonaut.com/api/v2/companies?type=all&sort=id", nil)
req.Header.Add("userApiKey", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/aylien/aylien.go b/pkg/detectors/aylien/aylien.go
index c5329c430..7288da96c 100644
--- a/pkg/detectors/aylien/aylien.go
+++ b/pkg/detectors/aylien/aylien.go
@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(resMatch),
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.aylien.com/news/stories", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.aylien.com/news/stories", nil)
req.Header.Add("X-AYLIEN-NewsAPI-Application-ID", resIdMatch)
req.Header.Add("X-AYLIEN-NewsAPI-Application-Key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/ayrshare/ayrshare.go b/pkg/detectors/ayrshare/ayrshare.go
index 603e6b532..56a73f179 100644
--- a/pkg/detectors/ayrshare/ayrshare.go
+++ b/pkg/detectors/ayrshare/ayrshare.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.ayrshare.com/api/analytics/links", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.ayrshare.com/api/analytics/links", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/bannerbear/bannerbear.go b/pkg/detectors/bannerbear/bannerbear.go
index ef7a98a6d..a965b3318 100644
--- a/pkg/detectors/bannerbear/bannerbear.go
+++ b/pkg/detectors/bannerbear/bannerbear.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.bannerbear.com/v2/auth", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.bannerbear.com/v2/auth", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/baremetrics/baremetrics.go b/pkg/detectors/baremetrics/baremetrics.go
index f97af9711..5f29ff4be 100644
--- a/pkg/detectors/baremetrics/baremetrics.go
+++ b/pkg/detectors/baremetrics/baremetrics.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.baremetrics.com/v1/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.baremetrics.com/v1/account", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/baseapiio/baseapiio.go b/pkg/detectors/baseapiio/baseapiio.go
index ce0047505..f0ec50ff1 100644
--- a/pkg/detectors/baseapiio/baseapiio.go
+++ b/pkg/detectors/baseapiio/baseapiio.go
@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("name", "\"My Form\"")
- req, _ := http.NewRequest("POST", "https://api.base-api.io/v1/forms", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.base-api.io/v1/forms", payload)
req.Header.Set("Content-Type", writer.FormDataContentType())
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/beamer/beamer.go b/pkg/detectors/beamer/beamer.go
index d71c16db4..35f4ef412 100644
--- a/pkg/detectors/beamer/beamer.go
+++ b/pkg/detectors/beamer/beamer.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.getbeamer.com/v0/url", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.getbeamer.com/v0/url", nil)
req.Header.Add("Beamer-Api-Key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/beebole/beebole.go b/pkg/detectors/beebole/beebole.go
index 37f6e972f..d2d837430 100644
--- a/pkg/detectors/beebole/beebole.go
+++ b/pkg/detectors/beebole/beebole.go
@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:X", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
payload := strings.NewReader(`{"service": "custom_field.list"}`)
- req, _ := http.NewRequest("POST", "https://beebole-apps.com/api/v2", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://beebole-apps.com/api/v2", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/besttime/besttime.go b/pkg/detectors/besttime/besttime.go
index d7b8b8da9..6a64ea7e2 100644
--- a/pkg/detectors/besttime/besttime.go
+++ b/pkg/detectors/besttime/besttime.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://besttime.app/api/v1/keys/"+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://besttime.app/api/v1/keys/"+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/billomat/billomat.go b/pkg/detectors/billomat/billomat.go
index e576b85c3..ab4e6f2d2 100644
--- a/pkg/detectors/billomat/billomat.go
+++ b/pkg/detectors/billomat/billomat.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://%s.billomat.net/api/v2/clients/myself", resId), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s.billomat.net/api/v2/clients/myself", resId), nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-BillomatApiKey", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/bitbar/bitbar.go b/pkg/detectors/bitbar/bitbar.go
index be8579fd5..249dffd35 100644
--- a/pkg/detectors/bitbar/bitbar.go
+++ b/pkg/detectors/bitbar/bitbar.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:", resMatch)
baseToken := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://cloud.bitbar.com/api/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://cloud.bitbar.com/api/me", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", baseToken))
res, err := client.Do(req)
diff --git a/pkg/detectors/bitcoinaverage/bitcoinaverage.go b/pkg/detectors/bitcoinaverage/bitcoinaverage.go
index 5c25241e3..23427b8a8 100644
--- a/pkg/detectors/bitcoinaverage/bitcoinaverage.go
+++ b/pkg/detectors/bitcoinaverage/bitcoinaverage.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(resMatch),
}
if verify {
- req, _ := http.NewRequest("GET", "https://apiv2.bitcoinaverage.com/websocket/get_ticket", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://apiv2.bitcoinaverage.com/websocket/get_ticket", nil)
req.Header.Add("x-ba-key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/bitlyaccesstoken/bitlyaccesstoken.go b/pkg/detectors/bitlyaccesstoken/bitlyaccesstoken.go
index bb2b340d5..71ab0c3c8 100644
--- a/pkg/detectors/bitlyaccesstoken/bitlyaccesstoken.go
+++ b/pkg/detectors/bitlyaccesstoken/bitlyaccesstoken.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api-ssl.bitly.com/v4/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api-ssl.bitly.com/v4/user", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/bitmex/bitmex.go b/pkg/detectors/bitmex/bitmex.go
index 647edbfba..0ff028c97 100644
--- a/pkg/detectors/bitmex/bitmex.go
+++ b/pkg/detectors/bitmex/bitmex.go
@@ -72,7 +72,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
signature := getBitmexSignature(timestamp, resSecretMatch, action, path, payload.Encode())
- req, _ := http.NewRequest(action, "https://www.bitmex.com"+path, strings.NewReader(payload.Encode()))
+ req, _ := http.NewRequestWithContext(ctx, action, "https://www.bitmex.com"+path, strings.NewReader(payload.Encode()))
req.Header.Add("api-expires", timestamp)
req.Header.Add("api-key", resMatch)
req.Header.Add("api-signature", signature)
diff --git a/pkg/detectors/blablabus/blablabus.go b/pkg/detectors/blablabus/blablabus.go
index 528db930a..82ecc7fe8 100644
--- a/pkg/detectors/blablabus/blablabus.go
+++ b/pkg/detectors/blablabus/blablabus.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.idbus.com/v3/stops", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.idbus.com/v3/stops", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Token %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/blazemeter/blazemeter.go b/pkg/detectors/blazemeter/blazemeter.go
index 10a8b3f60..d4c7b7935 100644
--- a/pkg/detectors/blazemeter/blazemeter.go
+++ b/pkg/detectors/blazemeter/blazemeter.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.runscope.com/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.runscope.com/account", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/blitapp/blitapp.go b/pkg/detectors/blitapp/blitapp.go
index 8fc4842f1..ac50bae17 100644
--- a/pkg/detectors/blitapp/blitapp.go
+++ b/pkg/detectors/blitapp/blitapp.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://blitapp.com/api/apps/all", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://blitapp.com/api/apps/all", nil)
req.Header.Add("API-Key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/blogger/blogger.go b/pkg/detectors/blogger/blogger.go
index b99ce1f08..d75956c66 100644
--- a/pkg/detectors/blogger/blogger.go
+++ b/pkg/detectors/blogger/blogger.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.googleapis.com/blogger/v3/blogs/2399953?key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.googleapis.com/blogger/v3/blogs/2399953?key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/bombbomb/bombbomb.go b/pkg/detectors/bombbomb/bombbomb.go
index 5e8b0e380..a9a9e75e4 100644
--- a/pkg/detectors/bombbomb/bombbomb.go
+++ b/pkg/detectors/bombbomb/bombbomb.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.bombbomb.com/v2/lists/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.bombbomb.com/v2/lists/", nil)
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/brandfetch/brandfetch.go b/pkg/detectors/brandfetch/brandfetch.go
index b5738e084..c3b3db663 100644
--- a/pkg/detectors/brandfetch/brandfetch.go
+++ b/pkg/detectors/brandfetch/brandfetch.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
payload := strings.NewReader(`{
"domain": "www.example.com"
}`)
- req, _ := http.NewRequest("POST", "https://api.brandfetch.io/v1/color", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.brandfetch.io/v1/color", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/browshot/browshot.go b/pkg/detectors/browshot/browshot.go
index 41fe5d4d3..120813e81 100644
--- a/pkg/detectors/browshot/browshot.go
+++ b/pkg/detectors/browshot/browshot.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.browshot.com/api/v1/instance/list?key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.browshot.com/api/v1/instance/list?key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/buddyns/buddyns.go b/pkg/detectors/buddyns/buddyns.go
index a79424db6..968a8c85c 100644
--- a/pkg/detectors/buddyns/buddyns.go
+++ b/pkg/detectors/buddyns/buddyns.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.buddyns.com/api/v2/zone/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.buddyns.com/api/v2/zone/", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Token %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/bugherd/bugherd.go b/pkg/detectors/bugherd/bugherd.go
index 410685ae0..02a29a21d 100644
--- a/pkg/detectors/bugherd/bugherd.go
+++ b/pkg/detectors/bugherd/bugherd.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:x", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://www.bugherd.com/api_v2/projects.json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.bugherd.com/api_v2/projects.json", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/bugsnag/bugsnag.go b/pkg/detectors/bugsnag/bugsnag.go
index 9e63e98f8..9173f9367 100644
--- a/pkg/detectors/bugsnag/bugsnag.go
+++ b/pkg/detectors/bugsnag/bugsnag.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.bugsnag.com/user/organizations?admin", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.bugsnag.com/user/organizations?admin", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("token %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/buildkite/buildkite.go b/pkg/detectors/buildkite/buildkite.go
index 38efe88ac..09216c164 100644
--- a/pkg/detectors/buildkite/buildkite.go
+++ b/pkg/detectors/buildkite/buildkite.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.buildkite.com/v2/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.buildkite.com/v2/user", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/bulbul/bulbul.go b/pkg/detectors/bulbul/bulbul.go
index 5bac39df5..80383dba3 100644
--- a/pkg/detectors/bulbul/bulbul.go
+++ b/pkg/detectors/bulbul/bulbul.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://prod-api.bulbul.io/view_all_users?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://prod-api.bulbul.io/view_all_users?api_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/buttercms/buttercms.go b/pkg/detectors/buttercms/buttercms.go
index 9ed906541..46bdfc3e2 100644
--- a/pkg/detectors/buttercms/buttercms.go
+++ b/pkg/detectors/buttercms/buttercms.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.buttercms.com/v2/posts/?auth_token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.buttercms.com/v2/posts/?auth_token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/caflou/caflou.go b/pkg/detectors/caflou/caflou.go
index 4209f33be..ca2126980 100644
--- a/pkg/detectors/caflou/caflou.go
+++ b/pkg/detectors/caflou/caflou.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", "https://app.caflou.com/api/v1/accounts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.caflou.com/api/v1/accounts", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/calendarific/calendarific.go b/pkg/detectors/calendarific/calendarific.go
index 3fd685b98..09667c114 100644
--- a/pkg/detectors/calendarific/calendarific.go
+++ b/pkg/detectors/calendarific/calendarific.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://calendarific.com/api/v2/holidays?&api_key="+resMatch+"&country=US&year=2019", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://calendarific.com/api/v2/holidays?&api_key="+resMatch+"&country=US&year=2019", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/calendlyapikey/calendlyapikey.go b/pkg/detectors/calendlyapikey/calendlyapikey.go
index a48b8778f..f234647d5 100644
--- a/pkg/detectors/calendlyapikey/calendlyapikey.go
+++ b/pkg/detectors/calendlyapikey/calendlyapikey.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.calendly.com/users/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.calendly.com/users/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/calorieninja/calorieninja.go b/pkg/detectors/calorieninja/calorieninja.go
index d0b49f7fe..f7b1b4c53 100644
--- a/pkg/detectors/calorieninja/calorieninja.go
+++ b/pkg/detectors/calorieninja/calorieninja.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.calorieninjas.com/v1/nutrition?query", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.calorieninjas.com/v1/nutrition?query", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-Api-Key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/campayn/campayn.go b/pkg/detectors/campayn/campayn.go
index 02f51626f..6521788bc 100644
--- a/pkg/detectors/campayn/campayn.go
+++ b/pkg/detectors/campayn/campayn.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://campayn.com/api/v1/lists", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://campayn.com/api/v1/lists", nil)
req.Header.Add("Authorization", "TRUEREST apikey="+resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/cannyio/cannyio.go b/pkg/detectors/cannyio/cannyio.go
index aa36a6fdb..2e93b769e 100644
--- a/pkg/detectors/cannyio/cannyio.go
+++ b/pkg/detectors/cannyio/cannyio.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader("apiKey=" + resMatch)
- req, _ := http.NewRequest("POST", "https://canny.io/api/v1/boards/list", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://canny.io/api/v1/boards/list", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/capsulecrm/capsulecrm.go b/pkg/detectors/capsulecrm/capsulecrm.go
index a8ac7e371..76e28f115 100644
--- a/pkg/detectors/capsulecrm/capsulecrm.go
+++ b/pkg/detectors/capsulecrm/capsulecrm.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.capsulecrm.com/api/v2/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.capsulecrm.com/api/v2/users", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/carboninterface/carboninterface.go b/pkg/detectors/carboninterface/carboninterface.go
index 46e46732c..fc6678ed8 100644
--- a/pkg/detectors/carboninterface/carboninterface.go
+++ b/pkg/detectors/carboninterface/carboninterface.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"type":"flight","passengers":2,"legs":[{"departure_airport":"sfo","destination_airport":"yyz"},{"departure_airport":"yyz","destination_airport":"sfo"}]}`)
- req, _ := http.NewRequest("POST", "https://www.carboninterface.com/api/v1/estimates", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://www.carboninterface.com/api/v1/estimates", payload)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
req.Header.Add("Content-type", "application/json")
res, err := client.Do(req)
diff --git a/pkg/detectors/cashboard/cashboard.go b/pkg/detectors/cashboard/cashboard.go
index 958e1e7f8..34822c57c 100644
--- a/pkg/detectors/cashboard/cashboard.go
+++ b/pkg/detectors/cashboard/cashboard.go
@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", resUser, resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.cashboardapp.com/account.xml", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.cashboardapp.com/account.xml", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/censys/censys.go b/pkg/detectors/censys/censys.go
index 1b6cac497..4e3e89397 100644
--- a/pkg/detectors/censys/censys.go
+++ b/pkg/detectors/censys/censys.go
@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://search.censys.io/api/v1/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://search.censys.io/api/v1/account", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/centralstationcrm/centralstationcrm.go b/pkg/detectors/centralstationcrm/centralstationcrm.go
index 8abfe1920..19bfbb8f7 100644
--- a/pkg/detectors/centralstationcrm/centralstationcrm.go
+++ b/pkg/detectors/centralstationcrm/centralstationcrm.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.centralstationcrm.net/api/users.json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.centralstationcrm.net/api/users.json", nil)
req.Header.Add("X-apikey", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/chatbot/chatbot.go b/pkg/detectors/chatbot/chatbot.go
index 8c9f21f5c..ae320b2a7 100644
--- a/pkg/detectors/chatbot/chatbot.go
+++ b/pkg/detectors/chatbot/chatbot.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.chatbot.com/stories", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.chatbot.com/stories", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/checio/checio.go b/pkg/detectors/checio/checio.go
index 09598fe9c..29407d71a 100644
--- a/pkg/detectors/checio/checio.go
+++ b/pkg/detectors/checio/checio.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.chec.io/v1/products?limit=25", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.chec.io/v1/products?limit=25", nil)
req.Header.Add("X-Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/checklyhq/checklyhq.go b/pkg/detectors/checklyhq/checklyhq.go
index 6a231adf1..b148134fa 100644
--- a/pkg/detectors/checklyhq/checklyhq.go
+++ b/pkg/detectors/checklyhq/checklyhq.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.checklyhq.com/v1/checks", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.checklyhq.com/v1/checks", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/checkout/checkout.go b/pkg/detectors/checkout/checkout.go
index d9cd4cbdf..cf00960aa 100644
--- a/pkg/detectors/checkout/checkout.go
+++ b/pkg/detectors/checkout/checkout.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
//Used the app's sandbox environment for this case since I can't create a live account.
- req, _ := http.NewRequest("GET", "https://api.sandbox.checkout.com/customers/"+resIdMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.sandbox.checkout.com/customers/"+resIdMatch, nil)
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/cicero/cicero.go b/pkg/detectors/cicero/cicero.go
index a0ae478fc..a78c7087a 100644
--- a/pkg/detectors/cicero/cicero.go
+++ b/pkg/detectors/cicero/cicero.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://cicero.azavea.com/v3.1/account/credits_remaining?key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://cicero.azavea.com/v3.1/account/credits_remaining?key=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/clarifai/clarifai.go b/pkg/detectors/clarifai/clarifai.go
index 4c1b59c7c..b2ee7accb 100644
--- a/pkg/detectors/clarifai/clarifai.go
+++ b/pkg/detectors/clarifai/clarifai.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
// test for api key
- req, _ := http.NewRequest("GET", "https://api.clarifai.com/v2/inputs", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.clarifai.com/v2/inputs", nil)
req.Header.Add("Authorization", fmt.Sprintf("Key %s", resMatch))
res, err := client.Do(req)
if err == nil {
@@ -63,7 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if !s1.Verified {
// test for pat
- req, _ := http.NewRequest("GET", "https://api.clarifai.com/v2/users/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.clarifai.com/v2/users/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("Key %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/clearbit/clearbit.go b/pkg/detectors/clearbit/clearbit.go
index 0b94d26f7..32583787a 100644
--- a/pkg/detectors/clearbit/clearbit.go
+++ b/pkg/detectors/clearbit/clearbit.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://person.clearbit.com/v1/people/email/[email protected]", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://person.clearbit.com/v1/people/email/[email protected]", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/clickhelp/clickhelp.go b/pkg/detectors/clickhelp/clickhelp.go
index 65880dc40..d152806be 100644
--- a/pkg/detectors/clickhelp/clickhelp.go
+++ b/pkg/detectors/clickhelp/clickhelp.go
@@ -69,7 +69,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", resEmail, resKey)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://%s/api/v1/projects", resServer), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s/api/v1/projects", resServer), nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/clicksendsms/clicksendsms.go b/pkg/detectors/clicksendsms/clicksendsms.go
index e515e6ce6..de055c9b9 100644
--- a/pkg/detectors/clicksendsms/clicksendsms.go
+++ b/pkg/detectors/clicksendsms/clicksendsms.go
@@ -63,7 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:%s", resIdMatch, resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://rest.clicksend.com/v3/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://rest.clicksend.com/v3/account", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/clickuppersonaltoken/clickuppersonaltoken.go b/pkg/detectors/clickuppersonaltoken/clickuppersonaltoken.go
index 84d0f2e68..9bb5060ce 100644
--- a/pkg/detectors/clickuppersonaltoken/clickuppersonaltoken.go
+++ b/pkg/detectors/clickuppersonaltoken/clickuppersonaltoken.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.clickup.com/api/v2/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.clickup.com/api/v2/user", nil)
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/clinchpad/clinchpad.go b/pkg/detectors/clinchpad/clinchpad.go
index ef77d6754..5e936f2df 100644
--- a/pkg/detectors/clinchpad/clinchpad.go
+++ b/pkg/detectors/clinchpad/clinchpad.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("api-key:%s", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://www.clinchpad.com/api/v1/pipelines", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.clinchpad.com/api/v1/pipelines", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/clockify/clockify.go b/pkg/detectors/clockify/clockify.go
index ac1663a10..a08cd4016 100644
--- a/pkg/detectors/clockify/clockify.go
+++ b/pkg/detectors/clockify/clockify.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.clockify.me/api/v1/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.clockify.me/api/v1/user", nil)
req.Header.Add("content-type", "application/json")
req.Header.Add("X-Api-Key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/clockworksms/clockworksms.go b/pkg/detectors/clockworksms/clockworksms.go
index 3882c1d2a..0c4123e00 100644
--- a/pkg/detectors/clockworksms/clockworksms.go
+++ b/pkg/detectors/clockworksms/clockworksms.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.textanywhere.com/API/v1.0/REST/status", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.textanywhere.com/API/v1.0/REST/status", nil)
req.Header.Add("user_key", resMatch)
req.Header.Add("access_token", tokenRes)
res, err := client.Do(req)
diff --git a/pkg/detectors/closecrm/close.go b/pkg/detectors/closecrm/close.go
index 680d44bf2..7190f9b85 100644
--- a/pkg/detectors/closecrm/close.go
+++ b/pkg/detectors/closecrm/close.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.close.com/api/v1/me/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.close.com/api/v1/me/", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
diff --git a/pkg/detectors/cloudelements/cloudelements.go b/pkg/detectors/cloudelements/cloudelements.go
index 5ad92c7cf..f03437f0c 100644
--- a/pkg/detectors/cloudelements/cloudelements.go
+++ b/pkg/detectors/cloudelements/cloudelements.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://staging.cloud-elements.com/elements/api-v2/accounts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://staging.cloud-elements.com/elements/api-v2/accounts", nil)
req.Header.Add("Authorization", fmt.Sprintf("User %s, Organization %s", resMatch, resOrgMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/cloudflareapitoken/cloudflareapitoken.go b/pkg/detectors/cloudflareapitoken/cloudflareapitoken.go
index f66e2ca97..526f71b8b 100644
--- a/pkg/detectors/cloudflareapitoken/cloudflareapitoken.go
+++ b/pkg/detectors/cloudflareapitoken/cloudflareapitoken.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.cloudflare.com/client/v4/user/tokens/verify", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.cloudflare.com/client/v4/user/tokens/verify", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/cloudflarecakey/cloudflarecakey.go b/pkg/detectors/cloudflarecakey/cloudflarecakey.go
index 7c00cffd6..2c77129c9 100644
--- a/pkg/detectors/cloudflarecakey/cloudflarecakey.go
+++ b/pkg/detectors/cloudflarecakey/cloudflarecakey.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.cloudflare.com/client/v4/certificates?zone_id=a", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.cloudflare.com/client/v4/certificates?zone_id=a", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("user-agent", "curl/7.68.0") // pretend to be from curl so we do not wait 100+ seconds -> nice try did not work
diff --git a/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go b/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go
index 5563ec269..f7936a08b 100644
--- a/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go
+++ b/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go
@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.cloudflare.com/client/v4/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.cloudflare.com/client/v4/user", nil)
req.Header.Add("X-Auth-Email", emailRes)
req.Header.Add("X-Auth-Key", apiKeyRes)
req.Header.Add("Content-Type", "application/json")
diff --git a/pkg/detectors/cloudmersive/cloudmersive.go b/pkg/detectors/cloudmersive/cloudmersive.go
index d915b840e..2ad964ece 100644
--- a/pkg/detectors/cloudmersive/cloudmersive.go
+++ b/pkg/detectors/cloudmersive/cloudmersive.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"AddressString":"string","CapitalizationMode":"string"}`)
- req, _ := http.NewRequest("POST", "https://api.cloudmersive.com/validate/address/parse", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.cloudmersive.com/validate/address/parse", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Apikey", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/cloudplan/cloudplan.go b/pkg/detectors/cloudplan/cloudplan.go
index 46d6628f9..9e81b5917 100644
--- a/pkg/detectors/cloudplan/cloudplan.go
+++ b/pkg/detectors/cloudplan/cloudplan.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.cloudplan.biz/api/user/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.cloudplan.biz/api/user/me", nil)
req.Header.Add("session_id", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/cloverly/cloverly.go b/pkg/detectors/cloverly/cloverly.go
index 367fb77a9..574ea95cd 100644
--- a/pkg/detectors/cloverly/cloverly.go
+++ b/pkg/detectors/cloverly/cloverly.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.cloverly.com/2019-03-beta/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.cloverly.com/2019-03-beta/account", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/clustdoc/clustdoc.go b/pkg/detectors/clustdoc/clustdoc.go
index e4c774839..1aa5a53ee 100644
--- a/pkg/detectors/clustdoc/clustdoc.go
+++ b/pkg/detectors/clustdoc/clustdoc.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://clustdoc.com/api/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://clustdoc.com/api/users", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/codacy/codacy.go b/pkg/detectors/codacy/codacy.go
index 79b8f5f11..9839546de 100644
--- a/pkg/detectors/codacy/codacy.go
+++ b/pkg/detectors/codacy/codacy.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.codacy.com/api/v3/version", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.codacy.com/api/v3/version", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("api-token", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/coinapi/coinapi.go b/pkg/detectors/coinapi/coinapi.go
index e178c641a..3c90c3e4b 100644
--- a/pkg/detectors/coinapi/coinapi.go
+++ b/pkg/detectors/coinapi/coinapi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://rest.coinapi.io/v1/exchanges", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://rest.coinapi.io/v1/exchanges", nil)
req.Header.Add("X-CoinAPI-Key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/coinbase/coinbase.go b/pkg/detectors/coinbase/coinbase.go
index faa137baa..f9543afb7 100644
--- a/pkg/detectors/coinbase/coinbase.go
+++ b/pkg/detectors/coinbase/coinbase.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.coinbase.com/v2/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.coinbase.com/v2/user", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/coinlayer/coinlayer.go b/pkg/detectors/coinlayer/coinlayer.go
index 8e5a78b82..539510222 100644
--- a/pkg/detectors/coinlayer/coinlayer.go
+++ b/pkg/detectors/coinlayer/coinlayer.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.coinlayer.com/api/live?access_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.coinlayer.com/api/live?access_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/coinlib/coinlib.go b/pkg/detectors/coinlib/coinlib.go
index 425a72552..a8dc05307 100644
--- a/pkg/detectors/coinlib/coinlib.go
+++ b/pkg/detectors/coinlib/coinlib.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://coinlib.io/api/v1/global?key=%s&pref=EUR", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://coinlib.io/api/v1/global?key=%s&pref=EUR", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/commercejs/commercejs.go b/pkg/detectors/commercejs/commercejs.go
index 7e918184d..83016775a 100644
--- a/pkg/detectors/commercejs/commercejs.go
+++ b/pkg/detectors/commercejs/commercejs.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.chec.io/v1/categories", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.chec.io/v1/categories", nil)
req.Header.Add("X-Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/commodities/commodities.go b/pkg/detectors/commodities/commodities.go
index 35f9e5435..03b9cc0fc 100644
--- a/pkg/detectors/commodities/commodities.go
+++ b/pkg/detectors/commodities/commodities.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
client.Timeout = 5 * time.Second
- req, _ := http.NewRequest("GET", "https://commodities-api.com/api/latest?access_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://commodities-api.com/api/latest?access_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/companyhub/companyhub.go b/pkg/detectors/companyhub/companyhub.go
index 23c0fcc8d..abd5ccad2 100644
--- a/pkg/detectors/companyhub/companyhub.go
+++ b/pkg/detectors/companyhub/companyhub.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.companyhub.com/v1/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.companyhub.com/v1/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("%s %s", resIdMatch, resMatch))
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
diff --git a/pkg/detectors/confluent/confluent.go b/pkg/detectors/confluent/confluent.go
index 611be5d7d..f5c929795 100644
--- a/pkg/detectors/confluent/confluent.go
+++ b/pkg/detectors/confluent/confluent.go
@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", resMatch, resSecret)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.telemetry.confluent.cloud/v2/metrics/cloud/descriptors/resources", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.telemetry.confluent.cloud/v2/metrics/cloud/descriptors/resources", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/contentfulpersonalaccesstoken/contentfulpersonalaccesstoken.go b/pkg/detectors/contentfulpersonalaccesstoken/contentfulpersonalaccesstoken.go
index ddf9a1609..9bd403ae0 100644
--- a/pkg/detectors/contentfulpersonalaccesstoken/contentfulpersonalaccesstoken.go
+++ b/pkg/detectors/contentfulpersonalaccesstoken/contentfulpersonalaccesstoken.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.contentful.com/organizations", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.contentful.com/organizations", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", keyRes))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/convertkit/convertkit.go b/pkg/detectors/convertkit/convertkit.go
index e4d5cd539..2807ece26 100644
--- a/pkg/detectors/convertkit/convertkit.go
+++ b/pkg/detectors/convertkit/convertkit.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.convertkit.com/v3/forms?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.convertkit.com/v3/forms?api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/copper/copper.go b/pkg/detectors/copper/copper.go
index 8d5d52d45..310797f18 100644
--- a/pkg/detectors/copper/copper.go
+++ b/pkg/detectors/copper/copper.go
@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
"page_size": 25,
"sort_by": "name"
}`)
- req, _ := http.NewRequest("POST", "https://api.copper.com/developer_api/v1/tasks/search", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.copper.com/developer_api/v1/tasks/search", payload)
req.Header.Add("X-PW-AccessToken", resMatch)
req.Header.Add("X-PW-Application", "developer_api")
req.Header.Add("X-PW-UserEmail", resIdMatch)
diff --git a/pkg/detectors/countrylayer/countrylayer.go b/pkg/detectors/countrylayer/countrylayer.go
index 3d3ab6642..a3ea6bac6 100644
--- a/pkg/detectors/countrylayer/countrylayer.go
+++ b/pkg/detectors/countrylayer/countrylayer.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.countrylayer.com/v2/all?access_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.countrylayer.com/v2/all?access_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/courier/courier.go b/pkg/detectors/courier/courier.go
index 46e35a8c7..4dbede762 100644
--- a/pkg/detectors/courier/courier.go
+++ b/pkg/detectors/courier/courier.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.courier.com/preferences", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.courier.com/preferences", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/coveralls/coveralls.go b/pkg/detectors/coveralls/coveralls.go
index 884bccb11..54320d177 100644
--- a/pkg/detectors/coveralls/coveralls.go
+++ b/pkg/detectors/coveralls/coveralls.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://coveralls.io/api/repos/github/secretscanner02/scanner", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://coveralls.io/api/repos/github/secretscanner02/scanner", nil)
req.Header.Add("Authorization", fmt.Sprintf("token %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/crowdin/crowdin.go b/pkg/detectors/crowdin/crowdin.go
index 636f3bc7c..f846691c2 100644
--- a/pkg/detectors/crowdin/crowdin.go
+++ b/pkg/detectors/crowdin/crowdin.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
- req, _ := http.NewRequest("GET", "https://api.crowdin.com/api/v2/storages", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.crowdin.com/api/v2/storages", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/cryptocompare/cryptocompare.go b/pkg/detectors/cryptocompare/cryptocompare.go
index 54ba064f3..62c9d2e61 100644
--- a/pkg/detectors/cryptocompare/cryptocompare.go
+++ b/pkg/detectors/cryptocompare/cryptocompare.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://min-api.cryptocompare.com/data/blockchain/list?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://min-api.cryptocompare.com/data/blockchain/list?api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/currencycloud/currencycloud.go b/pkg/detectors/currencycloud/currencycloud.go
index bfc843209..d6b1db7e5 100644
--- a/pkg/detectors/currencycloud/currencycloud.go
+++ b/pkg/detectors/currencycloud/currencycloud.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
// Get authentication token
payload := strings.NewReader(`{"login_id":"` + resEmailMatch + `","api_key":"` + resMatch + `"`)
- req, _ := http.NewRequest("POST", "https://devapi.currencycloud.com/v2/authenticate/api", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://devapi.currencycloud.com/v2/authenticate/api", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/currencyfreaks/currencyfreaks.go b/pkg/detectors/currencyfreaks/currencyfreaks.go
index 9b5e6427d..b52403778 100644
--- a/pkg/detectors/currencyfreaks/currencyfreaks.go
+++ b/pkg/detectors/currencyfreaks/currencyfreaks.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.currencyfreaks.com/latest?apikey="+resMatch+"&format=xml", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.currencyfreaks.com/latest?apikey="+resMatch+"&format=xml", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/currencylayer/currencylayer.go b/pkg/detectors/currencylayer/currencylayer.go
index 1b1abcbf2..0ad6359a0 100644
--- a/pkg/detectors/currencylayer/currencylayer.go
+++ b/pkg/detectors/currencylayer/currencylayer.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.currencylayer.com/live?access_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.currencylayer.com/live?access_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err2 := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/currencyscoop/currencyscoop.go b/pkg/detectors/currencyscoop/currencyscoop.go
index 5c032a340..110305e2f 100644
--- a/pkg/detectors/currencyscoop/currencyscoop.go
+++ b/pkg/detectors/currencyscoop/currencyscoop.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.currencyscoop.com/v1/latest?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.currencyscoop.com/v1/latest?api_key=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/currentsapi/currentsapi.go b/pkg/detectors/currentsapi/currentsapi.go
index 46f3c6ffa..efc219bea 100644
--- a/pkg/detectors/currentsapi/currentsapi.go
+++ b/pkg/detectors/currentsapi/currentsapi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.currentsapi.services/v1/latest-news", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.currentsapi.services/v1/latest-news", nil)
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/customerguru/customerguru.go b/pkg/detectors/customerguru/customerguru.go
index 12e6bc8f3..e9f8e83a9 100644
--- a/pkg/detectors/customerguru/customerguru.go
+++ b/pkg/detectors/customerguru/customerguru.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://customer.guru/export/customers?api_secret="+resIdMatch+"&api_token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://customer.guru/export/customers?api_secret="+resIdMatch+"&api_token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/customerio/customerio.go b/pkg/detectors/customerio/customerio.go
index 6c0fabdd3..06d096385 100644
--- a/pkg/detectors/customerio/customerio.go
+++ b/pkg/detectors/customerio/customerio.go
@@ -63,7 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:%s", resIdMatch, resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("POST", "https://track.customer.io/api/v1/customers/5/events", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://track.customer.io/api/v1/customers/5/events", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/d7network/d7network.go b/pkg/detectors/d7network/d7network.go
index 50523b484..8a6659ca1 100644
--- a/pkg/detectors/d7network/d7network.go
+++ b/pkg/detectors/d7network/d7network.go
@@ -47,7 +47,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://rest-api.d7networks.com/secure/balance", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://rest-api.d7networks.com/secure/balance", nil)
req.Header.Add("Authorization", "Basic "+resMatch)
res, err := http.DefaultClient.Do(req)
if err == nil {
diff --git a/pkg/detectors/dailyco/dailyco.go b/pkg/detectors/dailyco/dailyco.go
index 48ff41853..e06a0e48b 100644
--- a/pkg/detectors/dailyco/dailyco.go
+++ b/pkg/detectors/dailyco/dailyco.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.daily.co/v1/rooms", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.daily.co/v1/rooms", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/dandelion/dandelion.go b/pkg/detectors/dandelion/dandelion.go
index 778e548dd..34b77d6ce 100644
--- a/pkg/detectors/dandelion/dandelion.go
+++ b/pkg/detectors/dandelion/dandelion.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.dandelion.eu/datatxt/li/v1/?text=Smart&token=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.dandelion.eu/datatxt/li/v1/?text=Smart&token=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/datadogtoken/datadogtoken.go b/pkg/detectors/datadogtoken/datadogtoken.go
index 3599df8a4..6eb8ea1e7 100644
--- a/pkg/detectors/datadogtoken/datadogtoken.go
+++ b/pkg/detectors/datadogtoken/datadogtoken.go
@@ -59,7 +59,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
- req, _ := http.NewRequest("GET", "https://api.datadoghq.com/api/v2/users", nil)
+ req, err := http.NewRequestWithContext(ctx, "GET", "https://api.datadoghq.com/api/v2/users", nil)
+ if err != nil {
+ continue
+ }
req.Header.Add("Content-Type", "application/json")
req.Header.Add("DD-API-KEY", resApiMatch)
req.Header.Add("DD-APPLICATION-KEY", resMatch)
diff --git a/pkg/detectors/datafire/datafire.go b/pkg/detectors/datafire/datafire.go
index f70238639..04f477ddc 100644
--- a/pkg/detectors/datafire/datafire.go
+++ b/pkg/detectors/datafire/datafire.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.datafire.io/projects/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.datafire.io/projects/", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/datagov/datagov.go b/pkg/detectors/datagov/datagov.go
index e45930ec4..234a6956f 100644
--- a/pkg/detectors/datagov/datagov.go
+++ b/pkg/detectors/datagov/datagov.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.ers.usda.gov/data/arms/state?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.ers.usda.gov/data/arms/state?api_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/debounce/debounce.go b/pkg/detectors/debounce/debounce.go
index 698f48263..d19183ec4 100644
--- a/pkg/detectors/debounce/debounce.go
+++ b/pkg/detectors/debounce/debounce.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.debounce.io/v1/?api="+resMatch+"&[email protected]", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.debounce.io/v1/?api="+resMatch+"&[email protected]", nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/deepai/deepai.go b/pkg/detectors/deepai/deepai.go
index 91e507f34..50673f699 100644
--- a/pkg/detectors/deepai/deepai.go
+++ b/pkg/detectors/deepai/deepai.go
@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
writer.Close()
- req, _ := http.NewRequest("POST", "https://api.deepai.org/api/text-tagging", bytes.NewReader(body.Bytes()))
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.deepai.org/api/text-tagging", bytes.NewReader(body.Bytes()))
req.Header.Add("Content-Type", writer.FormDataContentType())
req.Header.Add("api-key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/deepgram/deepgram.go b/pkg/detectors/deepgram/deepgram.go
index 449c46c74..a337ed241 100644
--- a/pkg/detectors/deepgram/deepgram.go
+++ b/pkg/detectors/deepgram/deepgram.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.deepgram.com/v1/projects", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.deepgram.com/v1/projects", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Token %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/delighted/delighted.go b/pkg/detectors/delighted/delighted.go
index 5534fcc33..f7dd459d4 100644
--- a/pkg/detectors/delighted/delighted.go
+++ b/pkg/detectors/delighted/delighted.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
"email": "[email protected]",
"properties": { "Purchase Experience": "Mobile App", "State": "CA" }
}`)
- req, _ := http.NewRequest("POST", "https://api.delighted.com/v1/people.json", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.delighted.com/v1/people.json", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/deputy/deputy.go b/pkg/detectors/deputy/deputy.go
index eee289336..49c8d9b36 100644
--- a/pkg/detectors/deputy/deputy.go
+++ b/pkg/detectors/deputy/deputy.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://%s/api/v1/me", resURL), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s/api/v1/me", resURL), nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("OAuth %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/detectlanguage/detectlanguage.go b/pkg/detectors/detectlanguage/detectlanguage.go
index 00e2283d8..ee41ac0e0 100644
--- a/pkg/detectors/detectlanguage/detectlanguage.go
+++ b/pkg/detectors/detectlanguage/detectlanguage.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://ws.detectlanguage.com/0.2/user/status", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://ws.detectlanguage.com/0.2/user/status", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/dfuse/dfuse.go b/pkg/detectors/dfuse/dfuse.go
index c7ac971e1..12f95ed1d 100644
--- a/pkg/detectors/dfuse/dfuse.go
+++ b/pkg/detectors/dfuse/dfuse.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"api_key":"` + resMatch + `"}`)
- req, _ := http.NewRequest("POST", "https://auth.dfuse.io/v1/auth/issue", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://auth.dfuse.io/v1/auth/issue", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/digitaloceantoken/digitaloceantoken.go b/pkg/detectors/digitaloceantoken/digitaloceantoken.go
index 2ce7084ca..02e834b41 100644
--- a/pkg/detectors/digitaloceantoken/digitaloceantoken.go
+++ b/pkg/detectors/digitaloceantoken/digitaloceantoken.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.digitalocean.com/v2/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.digitalocean.com/v2/account", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/discordbottoken/discordbottoken.go b/pkg/detectors/discordbottoken/discordbottoken.go
index da5fc4a13..f8a610840 100644
--- a/pkg/detectors/discordbottoken/discordbottoken.go
+++ b/pkg/detectors/discordbottoken/discordbottoken.go
@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://discord.com/api/v8/users/"+resId, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://discord.com/api/v8/users/"+resId, nil)
req.Header.Add("Authorization", fmt.Sprintf("Bot %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/discordwebhook/discordwebhook.go b/pkg/detectors/discordwebhook/discordwebhook.go
index c2fd92277..6f1050872 100644
--- a/pkg/detectors/discordwebhook/discordwebhook.go
+++ b/pkg/detectors/discordwebhook/discordwebhook.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/ditto/ditto.go b/pkg/detectors/ditto/ditto.go
index 124e64b23..e945816bc 100644
--- a/pkg/detectors/ditto/ditto.go
+++ b/pkg/detectors/ditto/ditto.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.dittowords.com/variants", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.dittowords.com/variants", nil)
req.Header.Add("Authorization", fmt.Sprintf("token %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/dnscheck/dnscheck.go b/pkg/detectors/dnscheck/dnscheck.go
index f9c94d401..218af6eb1 100644
--- a/pkg/detectors/dnscheck/dnscheck.go
+++ b/pkg/detectors/dnscheck/dnscheck.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.dnscheck.co/api/v1/groups/"+resIdMatch+"?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.dnscheck.co/api/v1/groups/"+resIdMatch+"?api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/documo/documo.go b/pkg/detectors/documo/documo.go
index d174a57bc..08df3ad3c 100644
--- a/pkg/detectors/documo/documo.go
+++ b/pkg/detectors/documo/documo.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.documo.com/v1/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.documo.com/v1/me", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/doppler/doppler.go b/pkg/detectors/doppler/doppler.go
index ecb5106e8..219d06466 100644
--- a/pkg/detectors/doppler/doppler.go
+++ b/pkg/detectors/doppler/doppler.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.doppler.com/v3/workplace", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.doppler.com/v3/workplace", nil)
req.Header.Add("Accept", "application/json")
req.SetBasicAuth(resMatch, "")
res, err := client.Do(req)
diff --git a/pkg/detectors/dotmailer/dotmailer.go b/pkg/detectors/dotmailer/dotmailer.go
index 42135d028..78f482dbf 100644
--- a/pkg/detectors/dotmailer/dotmailer.go
+++ b/pkg/detectors/dotmailer/dotmailer.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", "https://r3-api.dotmailer.com/v2/account-info", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://r3-api.dotmailer.com/v2/account-info", nil)
req.SetBasicAuth(resMatch, resPassMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/dovico/dovico.go b/pkg/detectors/dovico/dovico.go
index 93ad4de4e..c7315f0c3 100644
--- a/pkg/detectors/dovico/dovico.go
+++ b/pkg/detectors/dovico/dovico.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.dovico.com/Employees/?version=7", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.dovico.com/Employees/?version=7", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf(`WRAP access_token="client=%s&user_token=%s"`, resMatch, resUser))
res, err := client.Do(req)
diff --git a/pkg/detectors/dronahq/dronahq.go b/pkg/detectors/dronahq/dronahq.go
index afcdfb7e0..baa760645 100644
--- a/pkg/detectors/dronahq/dronahq.go
+++ b/pkg/detectors/dronahq/dronahq.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://plugin.api.dronahq.com/users/?tokenkey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://plugin.api.dronahq.com/users/?tokenkey=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/droneci/droneci.go b/pkg/detectors/droneci/droneci.go
index 52104a96a..9eef35380 100644
--- a/pkg/detectors/droneci/droneci.go
+++ b/pkg/detectors/droneci/droneci.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://cloud.drone.io/api/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://cloud.drone.io/api/user", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/dropbox/dropbox.go b/pkg/detectors/dropbox/dropbox.go
index 922cdf77e..81b742095 100644
--- a/pkg/detectors/dropbox/dropbox.go
+++ b/pkg/detectors/dropbox/dropbox.go
@@ -47,7 +47,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
client := common.SaneHttpClient()
- req, _ := http.NewRequest("POST", baseURL, nil)
+ req, _ := http.NewRequestWithContext(ctx, "POST", baseURL, nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", match[1]))
res, err := client.Do(req)
if err != nil {
diff --git a/pkg/detectors/dwolla/dwolla.go b/pkg/detectors/dwolla/dwolla.go
index e0d1f2ef7..52bbdb20b 100644
--- a/pkg/detectors/dwolla/dwolla.go
+++ b/pkg/detectors/dwolla/dwolla.go
@@ -66,7 +66,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
encoded := b64.StdEncoding.EncodeToString([]byte(data))
payload := strings.NewReader("grant_type=client_credentials")
- req, _ := http.NewRequest("POST", "https://api-sandbox.dwolla.com/token", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api-sandbox.dwolla.com/token", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", encoded))
diff --git a/pkg/detectors/dynalist/dynalist.go b/pkg/detectors/dynalist/dynalist.go
index 2bc22fe32..c7105a898 100644
--- a/pkg/detectors/dynalist/dynalist.go
+++ b/pkg/detectors/dynalist/dynalist.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(fmt.Sprintf(`{"token": "%s"}`, resMatch))
- req, _ := http.NewRequest("POST", "https://dynalist.io/api/v1/file/list", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://dynalist.io/api/v1/file/list", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/dyspatch/dyspatch.go b/pkg/detectors/dyspatch/dyspatch.go
index 3a462ddc6..7206f3299 100644
--- a/pkg/detectors/dyspatch/dyspatch.go
+++ b/pkg/detectors/dyspatch/dyspatch.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.dyspatch.io/templates", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.dyspatch.io/templates", nil)
req.Header.Add("Accept", "application/vnd.dyspatch.2020.11+json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/eagleeyenetworks/eagleeyenetworks.go b/pkg/detectors/eagleeyenetworks/eagleeyenetworks.go
index f4bcbb827..a9caad7ee 100644
--- a/pkg/detectors/eagleeyenetworks/eagleeyenetworks.go
+++ b/pkg/detectors/eagleeyenetworks/eagleeyenetworks.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(fmt.Sprintf(`{"username": "%s", "password": "%s"}`, resEmailPatMatch, resMatch))
- req, _ := http.NewRequest("POST", "https://login.eagleeyenetworks.com/g/aaa/authenticate", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://login.eagleeyenetworks.com/g/aaa/authenticate", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/easyinsight/easyinsight.go b/pkg/detectors/easyinsight/easyinsight.go
index 0786901b3..73a95859a 100644
--- a/pkg/detectors/easyinsight/easyinsight.go
+++ b/pkg/detectors/easyinsight/easyinsight.go
@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", resIdMatch, resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://www.easy-insight.com/app/api/users.json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.easy-insight.com/app/api/users.json", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
diff --git a/pkg/detectors/edamam/edamam.go b/pkg/detectors/edamam/edamam.go
index 6699119f8..06cd01f21 100644
--- a/pkg/detectors/edamam/edamam.go
+++ b/pkg/detectors/edamam/edamam.go
@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.edamam.com/auto-complete?app_id=%s&app_key=%s&q=%s", resId, resMatch, ""), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.edamam.com/auto-complete?app_id=%s&app_key=%s&q=%s", resId, resMatch, ""), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/edenai/edenai.go b/pkg/detectors/edenai/edenai.go
index 3066d88d1..aea9d033e 100644
--- a/pkg/detectors/edenai/edenai.go
+++ b/pkg/detectors/edenai/edenai.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.edenai.run/v1/automl/text/project", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.edenai.run/v1/automl/text/project", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/elasticemail/elasticemail.go b/pkg/detectors/elasticemail/elasticemail.go
index 36e103527..27e98e366 100644
--- a/pkg/detectors/elasticemail/elasticemail.go
+++ b/pkg/detectors/elasticemail/elasticemail.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.elasticemail.com/v2/account/profileoverview?apikey="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.elasticemail.com/v2/account/profileoverview?apikey="+resMatch, nil)
res, err := client.Do(req)
if err != nil {
continue
diff --git a/pkg/detectors/enigma/enigma.go b/pkg/detectors/enigma/enigma.go
index 8f08373e9..eda00db5d 100644
--- a/pkg/detectors/enigma/enigma.go
+++ b/pkg/detectors/enigma/enigma.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"name":"Enigma Technologies, Inc.","person":{"first_name":"","last_name":""},"address":{"street_address1":"245 5th Ave","street_address2":"","city":"New York","state":"NY","postal_code":"10016"}}`)
- req, _ := http.NewRequest("POST", "https://api.enigma.com/businesses/match", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.enigma.com/businesses/match", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/ethplorer/ethplorer.go b/pkg/detectors/ethplorer/ethplorer.go
index 1a78357a5..bf5a18530 100644
--- a/pkg/detectors/ethplorer/ethplorer.go
+++ b/pkg/detectors/ethplorer/ethplorer.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader("apiKey=" + resMatch + "&addresses=0xb2930b35844a230f00e51431acae96fe543a0347%2C0xb52d3141ee731fac89927476c6a5207b37cd72ff")
- req, _ := http.NewRequest("POST", "https://api-mon.ethplorer.io/createPool", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api-mon.ethplorer.io/createPool", payload)
req.Header.Add("accept", "application/json")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
diff --git a/pkg/detectors/etsyapikey/etsyapikey.go b/pkg/detectors/etsyapikey/etsyapikey.go
index 0d82d8c66..43476601e 100644
--- a/pkg/detectors/etsyapikey/etsyapikey.go
+++ b/pkg/detectors/etsyapikey/etsyapikey.go
@@ -51,7 +51,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://openapi.etsy.com/v2/listings/active?api_key="+resMatch, nil)
+ req, err := http.NewRequestWithContext(ctx, "GET", "https://openapi.etsy.com/v2/listings/active?api_key="+resMatch, nil)
+ if err != nil {
+ continue
+ }
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/everhour/everhour.go b/pkg/detectors/everhour/everhour.go
index bac3481fc..e9c105ecd 100644
--- a/pkg/detectors/everhour/everhour.go
+++ b/pkg/detectors/everhour/everhour.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.everhour.com/clients", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.everhour.com/clients", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-Api-Key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/exchangerateapi/exchangerateapi.go b/pkg/detectors/exchangerateapi/exchangerateapi.go
index 45cbb2579..91de5432a 100644
--- a/pkg/detectors/exchangerateapi/exchangerateapi.go
+++ b/pkg/detectors/exchangerateapi/exchangerateapi.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://v6.exchangerate-api.com/v6/%s/latest/USD", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://v6.exchangerate-api.com/v6/%s/latest/USD", resMatch), nil)
req.Header.Add("Accept", "application/vnd.exchangerateapi+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/exchangeratesapi/exchangeratesapi.go b/pkg/detectors/exchangeratesapi/exchangeratesapi.go
index a9f23d339..b32c41699 100644
--- a/pkg/detectors/exchangeratesapi/exchangeratesapi.go
+++ b/pkg/detectors/exchangeratesapi/exchangeratesapi.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.exchangeratesapi.io/v1/latest?access_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.exchangeratesapi.io/v1/latest?access_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/facebookoauth/facebookoauth.go b/pkg/detectors/facebookoauth/facebookoauth.go
index cbf2ec9a6..f4e704cd7 100644
--- a/pkg/detectors/facebookoauth/facebookoauth.go
+++ b/pkg/detectors/facebookoauth/facebookoauth.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
// thanks https://stackoverflow.com/questions/15621471/validate-a-facebook-app-id-and-app-secret
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://graph.facebook.com/%s?fields=roles&access_token=%s|%s", apiIdRes, apiIdRes, apiSecretRes), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://graph.facebook.com/%s?fields=roles&access_token=%s|%s", apiIdRes, apiIdRes, apiSecretRes), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/faceplusplus/faceplusplus.go b/pkg/detectors/faceplusplus/faceplusplus.go
index 81f481333..77b5202cf 100644
--- a/pkg/detectors/faceplusplus/faceplusplus.go
+++ b/pkg/detectors/faceplusplus/faceplusplus.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("POST", fmt.Sprintf("https://api-us.faceplusplus.com/facepp/v3/faceset/getfacesets?api_key=%s&api_secret=%s", resMatch, resSecret), nil)
+ req, _ := http.NewRequestWithContext(ctx, "POST", fmt.Sprintf("https://api-us.faceplusplus.com/facepp/v3/faceset/getfacesets?api_key=%s&api_secret=%s", resMatch, resSecret), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/fakejson/fakejson.go b/pkg/detectors/fakejson/fakejson.go
index 2624693e6..2a5276850 100644
--- a/pkg/detectors/fakejson/fakejson.go
+++ b/pkg/detectors/fakejson/fakejson.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(fmt.Sprintf(`{"token":"%s","data":{"user_name":"nameFirst","user_email":"internetEmail","_repeat":3}}`, resMatch))
- req, _ := http.NewRequest("POST", "https://app.fakejson.com/q", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://app.fakejson.com/q", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/fastforex/fastforex.go b/pkg/detectors/fastforex/fastforex.go
index 3772d4ea2..c033670b9 100644
--- a/pkg/detectors/fastforex/fastforex.go
+++ b/pkg/detectors/fastforex/fastforex.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.fastforex.io/fetch-all?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.fastforex.io/fetch-all?api_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go b/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go
index 837ca340f..f85e18cb8 100644
--- a/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go
+++ b/pkg/detectors/fastlypersonaltoken/fastlypersonaltoken.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.fastly.com/services", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.fastly.com/services", nil)
req.Header.Add("Fastly-Key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/feedier/feedier.go b/pkg/detectors/feedier/feedier.go
index 4b5aa7298..88657a1be 100644
--- a/pkg/detectors/feedier/feedier.go
+++ b/pkg/detectors/feedier/feedier.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.feedier.com/v1/carriers", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.feedier.com/v1/carriers", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/fetchrss/fetchrss.go b/pkg/detectors/fetchrss/fetchrss.go
index 7c68183a8..91e62a9e7 100644
--- a/pkg/detectors/fetchrss/fetchrss.go
+++ b/pkg/detectors/fetchrss/fetchrss.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "http://fetchrss.com/api/v1/feed/create?auth="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "http://fetchrss.com/api/v1/feed/create?auth="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/figmapersonalaccesstoken/figmapersonalaccesstoken.go b/pkg/detectors/figmapersonalaccesstoken/figmapersonalaccesstoken.go
index 590a59ae4..76d67e290 100644
--- a/pkg/detectors/figmapersonalaccesstoken/figmapersonalaccesstoken.go
+++ b/pkg/detectors/figmapersonalaccesstoken/figmapersonalaccesstoken.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.figma.com/v1/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.figma.com/v1/me", nil)
req.Header.Add("X-Figma-Token", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/fileio/fileio.go b/pkg/detectors/fileio/fileio.go
index 96b0a764a..47b21ae86 100644
--- a/pkg/detectors/fileio/fileio.go
+++ b/pkg/detectors/fileio/fileio.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://file.io/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://file.io/", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/finage/finage.go b/pkg/detectors/finage/finage.go
index d52686630..80b5406db 100644
--- a/pkg/detectors/finage/finage.go
+++ b/pkg/detectors/finage/finage.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.finage.co.uk/symbol-list/crypto?apikey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.finage.co.uk/symbol-list/crypto?apikey=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/financialmodelingprep/financialmodelingprep.go b/pkg/detectors/financialmodelingprep/financialmodelingprep.go
index 019b6437d..85c0a9e48 100644
--- a/pkg/detectors/financialmodelingprep/financialmodelingprep.go
+++ b/pkg/detectors/financialmodelingprep/financialmodelingprep.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://financialmodelingprep.com/api/v3/financial-statement-symbol-lists?apikey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://financialmodelingprep.com/api/v3/financial-statement-symbol-lists?apikey=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/findl/findl.go b/pkg/detectors/findl/findl.go
index 2007b5d89..c507e6b70 100644
--- a/pkg/detectors/findl/findl.go
+++ b/pkg/detectors/findl/findl.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 5 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", "https://api.findl.com/v1.0/query?limit=6", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.findl.com/v1.0/query?limit=6", nil)
req.Header.Add("X-API-Key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/finnhub/finnhub.go b/pkg/detectors/finnhub/finnhub.go
index 5e751c501..b776cbad7 100644
--- a/pkg/detectors/finnhub/finnhub.go
+++ b/pkg/detectors/finnhub/finnhub.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://finnhub.io/api/v1/calendar/economic?token=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://finnhub.io/api/v1/calendar/economic?token=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/fixerio/fixerio.go b/pkg/detectors/fixerio/fixerio.go
index 41d8bc284..0dbd25c04 100644
--- a/pkg/detectors/fixerio/fixerio.go
+++ b/pkg/detectors/fixerio/fixerio.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "http://data.fixer.io/api/latest?access_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "http://data.fixer.io/api/latest?access_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/flatio/flatio.go b/pkg/detectors/flatio/flatio.go
index 7d7b6a216..5dcadaba5 100644
--- a/pkg/detectors/flatio/flatio.go
+++ b/pkg/detectors/flatio/flatio.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.flat.io/v2/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.flat.io/v2/me", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/fleetbase/fleetbase.go b/pkg/detectors/fleetbase/fleetbase.go
index 00d258a44..8cb436b62 100644
--- a/pkg/detectors/fleetbase/fleetbase.go
+++ b/pkg/detectors/fleetbase/fleetbase.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.fleetbase.io/v1/contacts/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.fleetbase.io/v1/contacts/", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/flickr/flickr.go b/pkg/detectors/flickr/flickr.go
index 84f658b0a..890e3ec42 100644
--- a/pkg/detectors/flickr/flickr.go
+++ b/pkg/detectors/flickr/flickr.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://www.flickr.com/services/rest/?method=flickr.tags.getHotList&api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://www.flickr.com/services/rest/?method=flickr.tags.getHotList&api_key=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/flightapi/flightapi.go b/pkg/detectors/flightapi/flightapi.go
index f0f1114ab..502e24401 100644
--- a/pkg/detectors/flightapi/flightapi.go
+++ b/pkg/detectors/flightapi/flightapi.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.flightapi.io/iata/%s/london/airport", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.flightapi.io/iata/%s/london/airport", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/float/float.go b/pkg/detectors/float/float.go
index a5320f76f..5ba9d9f5e 100644
--- a/pkg/detectors/float/float.go
+++ b/pkg/detectors/float/float.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.float.com/v3/people", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.float.com/v3/people", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/flowflu/flowflu.go b/pkg/detectors/flowflu/flowflu.go
index bd35f5d45..a3c69beeb 100644
--- a/pkg/detectors/flowflu/flowflu.go
+++ b/pkg/detectors/flowflu/flowflu.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://secretscanner.flowlu.com/api/v1/module/crm/lead/list?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://secretscanner.flowlu.com/api/v1/module/crm/lead/list?api_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/flutterwave/flutterwave.go b/pkg/detectors/flutterwave/flutterwave.go
index 7c0a1d172..1ed7320b2 100644
--- a/pkg/detectors/flutterwave/flutterwave.go
+++ b/pkg/detectors/flutterwave/flutterwave.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.flutterwave.com/v3/subaccounts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.flutterwave.com/v3/subaccounts", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/fmfw/fmfw.go b/pkg/detectors/fmfw/fmfw.go
index e251fe9be..a642c3582 100644
--- a/pkg/detectors/fmfw/fmfw.go
+++ b/pkg/detectors/fmfw/fmfw.go
@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", "https://api.fmfw.io/api/3/spot/balance", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.fmfw.io/api/3/spot/balance", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/foursquare/foursquare.go b/pkg/detectors/foursquare/foursquare.go
index e0215756c..26ae11f3f 100644
--- a/pkg/detectors/foursquare/foursquare.go
+++ b/pkg/detectors/foursquare/foursquare.go
@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.foursquare.com/v2/venues/trending?client_id=%s&client_secret=%s&v=20211019&near=LA", resMatch, resSecret), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.foursquare.com/v2/venues/trending?client_id=%s&client_secret=%s&v=20211019&near=LA", resMatch, resSecret), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/frameio/frameio.go b/pkg/detectors/frameio/frameio.go
index 52c51d4f1..43f25e1d0 100644
--- a/pkg/detectors/frameio/frameio.go
+++ b/pkg/detectors/frameio/frameio.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.frame.io/v2/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.frame.io/v2/me", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/freshbooks/freshbooks.go b/pkg/detectors/freshbooks/freshbooks.go
index b2c84d18d..f5e1b978e 100644
--- a/pkg/detectors/freshbooks/freshbooks.go
+++ b/pkg/detectors/freshbooks/freshbooks.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf(`https://auth.freshbooks.com/oauth/authorize?client_id=%s&redirect_uri=%s&response_type=code`, resMatch, resURI), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf(`https://auth.freshbooks.com/oauth/authorize?client_id=%s&redirect_uri=%s&response_type=code`, resMatch, resURI), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/freshdesk/freshdesk.go b/pkg/detectors/freshdesk/freshdesk.go
index 3e7c7af04..dbe31aa29 100644
--- a/pkg/detectors/freshdesk/freshdesk.go
+++ b/pkg/detectors/freshdesk/freshdesk.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:X", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://%s/api/v2/tickets", resURL), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s/api/v2/tickets", resURL), nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/front/front.go b/pkg/detectors/front/front.go
index 667a043e4..fb6fdf4ac 100644
--- a/pkg/detectors/front/front.go
+++ b/pkg/detectors/front/front.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api2.frontapp.com/accounts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api2.frontapp.com/accounts", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/fulcrum/fulcrum.go b/pkg/detectors/fulcrum/fulcrum.go
index fb7e50585..f323599f7 100644
--- a/pkg/detectors/fulcrum/fulcrum.go
+++ b/pkg/detectors/fulcrum/fulcrum.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.fulcrumapp.com/api/v2/forms.json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.fulcrumapp.com/api/v2/forms.json", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("X-ApiToken", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/fullstory/fullstory.go b/pkg/detectors/fullstory/fullstory.go
index 2a927e7e7..74ea02f20 100644
--- a/pkg/detectors/fullstory/fullstory.go
+++ b/pkg/detectors/fullstory/fullstory.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.fullstory.com/operations/v1", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.fullstory.com/operations/v1", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/fusebill/fusebill.go b/pkg/detectors/fusebill/fusebill.go
index c161efb2a..51d362869 100644
--- a/pkg/detectors/fusebill/fusebill.go
+++ b/pkg/detectors/fusebill/fusebill.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/fxmarket/fxmarket.go b/pkg/detectors/fxmarket/fxmarket.go
index 17d7b8a25..c4c248ac2 100644
--- a/pkg/detectors/fxmarket/fxmarket.go
+++ b/pkg/detectors/fxmarket/fxmarket.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://fxmarketapi.com/apilive?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://fxmarketapi.com/apilive?api_key=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/geckoboard/geckoboard.go b/pkg/detectors/geckoboard/geckoboard.go
index 7b935aae0..5237321e6 100644
--- a/pkg/detectors/geckoboard/geckoboard.go
+++ b/pkg/detectors/geckoboard/geckoboard.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.geckoboard.com/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.geckoboard.com/", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/gengo/gengo.go b/pkg/detectors/gengo/gengo.go
index 89c3b22c2..1a9e97657 100644
--- a/pkg/detectors/gengo/gengo.go
+++ b/pkg/detectors/gengo/gengo.go
@@ -71,7 +71,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
timestamp := strconv.FormatInt(time.Now().Unix(), 10)
signature := getGengoSignature(timestamp, resSecretMatch)
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.gengo.com/v2/account/me?ts=%s&api_key=%s&api_sig=%s", timestamp, resMatch, signature), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.gengo.com/v2/account/me?ts=%s&api_key=%s&api_sig=%s", timestamp, resMatch, signature), nil)
req.Header.Add("Accept", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/geoapify/geoapify.go b/pkg/detectors/geoapify/geoapify.go
index a66bd2fae..4b00e5c84 100644
--- a/pkg/detectors/geoapify/geoapify.go
+++ b/pkg/detectors/geoapify/geoapify.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.geoapify.com/v1/geocode/search?text=California&apiKey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.geoapify.com/v1/geocode/search?text=California&apiKey=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/geocode/geocode.go b/pkg/detectors/geocode/geocode.go
index 52fc3a0db..33bc52266 100644
--- a/pkg/detectors/geocode/geocode.go
+++ b/pkg/detectors/geocode/geocode.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://geocode.xyz/51.4647,0.0079?json=1&auth=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://geocode.xyz/51.4647,0.0079?json=1&auth=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/geocodify/geocodify.go b/pkg/detectors/geocodify/geocodify.go
index f7687f721..026656446 100644
--- a/pkg/detectors/geocodify/geocodify.go
+++ b/pkg/detectors/geocodify/geocodify.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.geocodify.com/v2/geocode?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.geocodify.com/v2/geocode?api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/geocodio/geocodio.go b/pkg/detectors/geocodio/geocodio.go
index f0c9ab577..0a349ba37 100644
--- a/pkg/detectors/geocodio/geocodio.go
+++ b/pkg/detectors/geocodio/geocodio.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.geocod.io/v1.6/geocode?q=%s&api_key=%s", resSearchMatch, resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.geocod.io/v1.6/geocode?q=%s&api_key=%s", resSearchMatch, resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/geoipifi/geoipifi.go b/pkg/detectors/geoipifi/geoipifi.go
index 300ee4ecb..12a29c5dc 100644
--- a/pkg/detectors/geoipifi/geoipifi.go
+++ b/pkg/detectors/geoipifi/geoipifi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://geo.ipify.org/api/v2/country?apiKey="+resMatch+"&ipAddress=8.8.8.8", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://geo.ipify.org/api/v2/country?apiKey="+resMatch+"&ipAddress=8.8.8.8", nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/getemail/getemail.go b/pkg/detectors/getemail/getemail.go
index 41951ded0..f84fbb87b 100644
--- a/pkg/detectors/getemail/getemail.go
+++ b/pkg/detectors/getemail/getemail.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.getemail.io/v1/find-mail?firstname=Larry&lastname=Page&domain=google.com&api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.getemail.io/v1/find-mail?firstname=Larry&lastname=Page&domain=google.com&api_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/getemails/getemails.go b/pkg/detectors/getemails/getemails.go
index 2f5f5c4b5..ddf83eec2 100644
--- a/pkg/detectors/getemails/getemails.go
+++ b/pkg/detectors/getemails/getemails.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.getemails.com/api/v1/contacts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.getemails.com/api/v1/contacts", nil)
req.Header.Add("api-key", resMatch)
req.Header.Add("api-id", resIdMatch)
diff --git a/pkg/detectors/getgeoapi/getgeoapi.go b/pkg/detectors/getgeoapi/getgeoapi.go
index 092e84b1d..17d0feee8 100644
--- a/pkg/detectors/getgeoapi/getgeoapi.go
+++ b/pkg/detectors/getgeoapi/getgeoapi.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.getgeoapi.com/v2/currency/list?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.getgeoapi.com/v2/currency/list?api_key=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/getgist/getgist.go b/pkg/detectors/getgist/getgist.go
index 8b1fd3bfd..57cfafa15 100644
--- a/pkg/detectors/getgist/getgist.go
+++ b/pkg/detectors/getgist/getgist.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.getgist.com/contacts/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.getgist.com/contacts/", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/getsandbox/getsandbox.go b/pkg/detectors/getsandbox/getsandbox.go
index 5399115b3..385bb7ad1 100644
--- a/pkg/detectors/getsandbox/getsandbox.go
+++ b/pkg/detectors/getsandbox/getsandbox.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://getsandbox.com/api/1/sandboxes/%s", resIdMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://getsandbox.com/api/1/sandboxes/%s", resIdMatch), nil)
req.Header.Add("API-Key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/githubapp/githubapp.go b/pkg/detectors/githubapp/githubapp.go
index d9da9d065..635e5eec1 100644
--- a/pkg/detectors/githubapp/githubapp.go
+++ b/pkg/detectors/githubapp/githubapp.go
@@ -82,7 +82,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
//end get token
- req, _ := http.NewRequest("GET", "https://api.github.com/app", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.github.com/app", nil)
req.Header.Add("Accept", "application/vnd.github.v3+json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", tokenString))
res, err := client.Do(req)
diff --git a/pkg/detectors/gitlab/gitlab.go b/pkg/detectors/gitlab/gitlab.go
index cea05d9b0..04c112e53 100644
--- a/pkg/detectors/gitlab/gitlab.go
+++ b/pkg/detectors/gitlab/gitlab.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
client := common.SaneHttpClient()
// test `read_user` scope
- req, _ := http.NewRequest("GET", baseURL+"/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", baseURL+"/user", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", match[1]))
res, err := client.Do(req)
if err != nil {
diff --git a/pkg/detectors/gitlabv2/gitlab.go b/pkg/detectors/gitlabv2/gitlab.go
index c7b69a583..c8f91a1cc 100644
--- a/pkg/detectors/gitlabv2/gitlab.go
+++ b/pkg/detectors/gitlabv2/gitlab.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
client := common.SaneHttpClient()
// test `read_user` scope
- req, _ := http.NewRequest("GET", baseURL+"/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", baseURL+"/user", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", match[1]))
res, err := client.Do(req)
if err != nil {
diff --git a/pkg/detectors/gitter/gitter.go b/pkg/detectors/gitter/gitter.go
index 9f81ff246..67c440341 100644
--- a/pkg/detectors/gitter/gitter.go
+++ b/pkg/detectors/gitter/gitter.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.gitter.im/v1/user/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.gitter.im/v1/user/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/glassnode/glassnode.go b/pkg/detectors/glassnode/glassnode.go
index 1b7e7b983..252b0fdcf 100644
--- a/pkg/detectors/glassnode/glassnode.go
+++ b/pkg/detectors/glassnode/glassnode.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.glassnode.com/v1/metrics/indicators/sopr?a=btc&api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.glassnode.com/v1/metrics/indicators/sopr?a=btc&api_key="+resMatch, nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/gocardless/gocardless.go b/pkg/detectors/gocardless/gocardless.go
index a6da73df8..9688be586 100644
--- a/pkg/detectors/gocardless/gocardless.go
+++ b/pkg/detectors/gocardless/gocardless.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.gocardless.com/customers/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.gocardless.com/customers/", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
req.Header.Add("GoCardless-Version", "2015-07-06")
diff --git a/pkg/detectors/goodday/goodday.go b/pkg/detectors/goodday/goodday.go
index fa081eaa3..d6dae6542 100644
--- a/pkg/detectors/goodday/goodday.go
+++ b/pkg/detectors/goodday/goodday.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.goodday.work/2.0/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.goodday.work/2.0/users", nil)
req.Header.Add("gd-api-token", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/graphcms/graphcms.go b/pkg/detectors/graphcms/graphcms.go
index a55a91234..0a0ef5727 100644
--- a/pkg/detectors/graphcms/graphcms.go
+++ b/pkg/detectors/graphcms/graphcms.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{users {id name}}`)
- req, _ := http.NewRequest("POST", "https://api-ap-northeast-1.graphcms.com/v2/"+resIdMatch+"/master", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api-ap-northeast-1.graphcms.com/v2/"+resIdMatch+"/master", payload)
req.Header.Add("Content-Type", "application/graphql")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
diff --git a/pkg/detectors/graphhopper/graphhopper.go b/pkg/detectors/graphhopper/graphhopper.go
index 68cf762b8..fed105833 100644
--- a/pkg/detectors/graphhopper/graphhopper.go
+++ b/pkg/detectors/graphhopper/graphhopper.go
@@ -47,7 +47,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(resMatch),
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://graphhopper.com/api/1/geocode?q=Philippines&key=%s&type=json", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://graphhopper.com/api/1/geocode?q=Philippines&key=%s&type=json", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/groovehq/groovehq.go b/pkg/detectors/groovehq/groovehq.go
index 9835a95fa..e2d3d5c27 100644
--- a/pkg/detectors/groovehq/groovehq.go
+++ b/pkg/detectors/groovehq/groovehq.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.groovehq.com/v1/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.groovehq.com/v1/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/guardianapi/guardianapi.go b/pkg/detectors/guardianapi/guardianapi.go
index 25f152ca2..1058c94ee 100644
--- a/pkg/detectors/guardianapi/guardianapi.go
+++ b/pkg/detectors/guardianapi/guardianapi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://content.guardianapis.com/search?api-key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://content.guardianapis.com/search?api-key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/guru/guru.go b/pkg/detectors/guru/guru.go
index 2bc3f187e..46e9a971e 100644
--- a/pkg/detectors/guru/guru.go
+++ b/pkg/detectors/guru/guru.go
@@ -65,7 +65,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:%s", unameMatch, keyMatch)
encoded := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.getguru.com/api/v1/teams/teamId/stats", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.getguru.com/api/v1/teams/teamId/stats", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", encoded))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/gyazo/gyazo.go b/pkg/detectors/gyazo/gyazo.go
index d3d56596b..e3a541fbc 100644
--- a/pkg/detectors/gyazo/gyazo.go
+++ b/pkg/detectors/gyazo/gyazo.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.gyazo.com/api/images?access_token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.gyazo.com/api/images?access_token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/happi/happi.go b/pkg/detectors/happi/happi.go
index 41435064b..402bdf4ee 100644
--- a/pkg/detectors/happi/happi.go
+++ b/pkg/detectors/happi/happi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.happi.dev/v1/exchange", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.happi.dev/v1/exchange", nil)
req.Header.Add("x-happi-key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/happyscribe/happyscribe.go b/pkg/detectors/happyscribe/happyscribe.go
index 266fdf32e..a26351293 100644
--- a/pkg/detectors/happyscribe/happyscribe.go
+++ b/pkg/detectors/happyscribe/happyscribe.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.happyscribe.com/api/v1/transcriptions", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.happyscribe.com/api/v1/transcriptions", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/harvest/harvest.go b/pkg/detectors/harvest/harvest.go
index 2dcf9b177..016704d9f 100644
--- a/pkg/detectors/harvest/harvest.go
+++ b/pkg/detectors/harvest/harvest.go
@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.harvestapp.com/v2/users/me?access_token="+resMatch+"&account_id="+resIdMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.harvestapp.com/v2/users/me?access_token="+resMatch+"&account_id="+resIdMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/hellosign/hellosign.go b/pkg/detectors/hellosign/hellosign.go
index 27afad884..5f5a1471c 100644
--- a/pkg/detectors/hellosign/hellosign.go
+++ b/pkg/detectors/hellosign/hellosign.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.hellosign.com/v3/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.hellosign.com/v3/account", nil)
req.SetBasicAuth(resMatch, "")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/helpcrunch/helpcrunch.go b/pkg/detectors/helpcrunch/helpcrunch.go
index 8f3f885f3..e88bf1046 100644
--- a/pkg/detectors/helpcrunch/helpcrunch.go
+++ b/pkg/detectors/helpcrunch/helpcrunch.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.helpcrunch.com/v1/departments", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.helpcrunch.com/v1/departments", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/helpscout/helpscout.go b/pkg/detectors/helpscout/helpscout.go
index a4c29432c..5009ee208 100644
--- a/pkg/detectors/helpscout/helpscout.go
+++ b/pkg/detectors/helpscout/helpscout.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://docsapi.helpscout.net/v1/collections", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://docsapi.helpscout.net/v1/collections", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/hereapi/hereapi.go b/pkg/detectors/hereapi/hereapi.go
index 71f6497e6..611be4bb0 100644
--- a/pkg/detectors/hereapi/hereapi.go
+++ b/pkg/detectors/hereapi/hereapi.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://weather.ls.hereapi.com/weather/1.0/report.json?product=alerts&name=Argentina&apiKey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://weather.ls.hereapi.com/weather/1.0/report.json?product=alerts&name=Argentina&apiKey=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/heroku/heroku.go b/pkg/detectors/heroku/heroku.go
index 6836dac65..dca48ae1a 100644
--- a/pkg/detectors/heroku/heroku.go
+++ b/pkg/detectors/heroku/heroku.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.heroku.com/apps", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.heroku.com/apps", nil)
req.Header.Add("Accept", "application/vnd.heroku+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/hive/hive.go b/pkg/detectors/hive/hive.go
index c8d7dfcaa..04464edc6 100644
--- a/pkg/detectors/hive/hive.go
+++ b/pkg/detectors/hive/hive.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.hive.com/api/v1/testcredentials?user_id="+idMatch+"&api_key="+keyMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.hive.com/api/v1/testcredentials?user_id="+idMatch+"&api_key="+keyMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/hiveage/hiveage.go b/pkg/detectors/hiveage/hiveage.go
index 5a6fa05b9..ad84b853a 100644
--- a/pkg/detectors/hiveage/hiveage.go
+++ b/pkg/detectors/hiveage/hiveage.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:", resMatch)
encoded := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://mltb8350.hiveage.com/api/network", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://mltb8350.hiveage.com/api/network", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", encoded))
res, err := client.Do(req)
diff --git a/pkg/detectors/holidayapi/holidayapi.go b/pkg/detectors/holidayapi/holidayapi.go
index 9a4bdffd3..cc779bd57 100644
--- a/pkg/detectors/holidayapi/holidayapi.go
+++ b/pkg/detectors/holidayapi/holidayapi.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://holidayapi.com/v1/holidays?key=%s&country=PH&year=2020", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://holidayapi.com/v1/holidays?key=%s&country=PH&year=2020", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/host/host.go b/pkg/detectors/host/host.go
index b56597e29..b1f595756 100644
--- a/pkg/detectors/host/host.go
+++ b/pkg/detectors/host/host.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://host.io/api/domains/ip/8.8.8.8?token=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://host.io/api/domains/ip/8.8.8.8?token=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/hubspotapikey/hubspotapikey.go b/pkg/detectors/hubspotapikey/hubspotapikey.go
index 26762efbf..92546b133 100644
--- a/pkg/detectors/hubspotapikey/hubspotapikey.go
+++ b/pkg/detectors/hubspotapikey/hubspotapikey.go
@@ -46,7 +46,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.hubapi.com/contacts/v1/lists?hapikey="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.hubapi.com/contacts/v1/lists?hapikey="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/humanity/humanity.go b/pkg/detectors/humanity/humanity.go
index 7844522cc..7a6d07d0d 100644
--- a/pkg/detectors/humanity/humanity.go
+++ b/pkg/detectors/humanity/humanity.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.humanity.com/api/v2/me?access_token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.humanity.com/api/v2/me?access_token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/hunter/hunter.go b/pkg/detectors/hunter/hunter.go
index fae8200bd..963d01ca4 100644
--- a/pkg/detectors/hunter/hunter.go
+++ b/pkg/detectors/hunter/hunter.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.hunter.io/v2/leads_lists?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.hunter.io/v2/leads_lists?api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/hypertrack/hypertrack.go b/pkg/detectors/hypertrack/hypertrack.go
index 294f0b1fb..3eb43d611 100644
--- a/pkg/detectors/hypertrack/hypertrack.go
+++ b/pkg/detectors/hypertrack/hypertrack.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://v3.api.hypertrack.com/trips/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://v3.api.hypertrack.com/trips/", nil)
req.SetBasicAuth(resAccMatch, resMatch)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
diff --git a/pkg/detectors/ibmclouduserkey/ibmclouduserkey.go b/pkg/detectors/ibmclouduserkey/ibmclouduserkey.go
index b4a5724fe..52d174e79 100644
--- a/pkg/detectors/ibmclouduserkey/ibmclouduserkey.go
+++ b/pkg/detectors/ibmclouduserkey/ibmclouduserkey.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`apikey=` + resMatch + `&grant_type=urn%3Aibm%3Aparams%3Aoauth%3Agrant-type%3Aapikey`)
- req, _ := http.NewRequest("POST", "https://iam.ng.bluemix.net/identity/token", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://iam.ng.bluemix.net/identity/token", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("Authorization", "Basic Yng6Yng=")
res, err := client.Do(req)
diff --git a/pkg/detectors/iconfinder/iconfinder.go b/pkg/detectors/iconfinder/iconfinder.go
index 05ebd5711..d2e8ba4b5 100644
--- a/pkg/detectors/iconfinder/iconfinder.go
+++ b/pkg/detectors/iconfinder/iconfinder.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.iconfinder.com/v4/iconsets", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.iconfinder.com/v4/iconsets", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/iexcloud/iexcloud.go b/pkg/detectors/iexcloud/iexcloud.go
index bb3a9a4a6..d5ad41cfa 100644
--- a/pkg/detectors/iexcloud/iexcloud.go
+++ b/pkg/detectors/iexcloud/iexcloud.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://cloud.iexapis.com/v1/stock/aapl/quote?token=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://cloud.iexapis.com/v1/stock/aapl/quote?token=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/imagekit/imagekit.go b/pkg/detectors/imagekit/imagekit.go
index 63f25feac..03c220d83 100644
--- a/pkg/detectors/imagekit/imagekit.go
+++ b/pkg/detectors/imagekit/imagekit.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(resMatch),
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.imagekit.io/v1/files", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.imagekit.io/v1/files", nil)
req.SetBasicAuth(resMatch, "")
res, err := client.Do(req)
diff --git a/pkg/detectors/imagga/imagga.go b/pkg/detectors/imagga/imagga.go
index ade80e1a7..0f57e4950 100644
--- a/pkg/detectors/imagga/imagga.go
+++ b/pkg/detectors/imagga/imagga.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.imagga.com/v2/usage", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.imagga.com/v2/usage", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/impala/impala.go b/pkg/detectors/impala/impala.go
index 7a8795bf5..e23c25758 100644
--- a/pkg/detectors/impala/impala.go
+++ b/pkg/detectors/impala/impala.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://sandbox.impala.travel/v1/bookings", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://sandbox.impala.travel/v1/bookings", nil)
req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/insightly/insightly.go b/pkg/detectors/insightly/insightly.go
index 68dd4ba03..235cd30e7 100644
--- a/pkg/detectors/insightly/insightly.go
+++ b/pkg/detectors/insightly/insightly.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.na1.insightly.com/v3.1/Contacts?top=2", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.na1.insightly.com/v3.1/Contacts?top=2", nil)
req.SetBasicAuth(resMatch, "")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/integromat/integromat.go b/pkg/detectors/integromat/integromat.go
index fb2f40cb8..88b339151 100644
--- a/pkg/detectors/integromat/integromat.go
+++ b/pkg/detectors/integromat/integromat.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.integromat.com/v1/whoami", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.integromat.com/v1/whoami", nil)
req.Header.Add("Authorization", fmt.Sprintf("Token %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/intercom/intercom.go b/pkg/detectors/intercom/intercom.go
index aa49c8cf2..47ad7d4fe 100644
--- a/pkg/detectors/intercom/intercom.go
+++ b/pkg/detectors/intercom/intercom.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.intercom.io/contacts?per_page=5", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.intercom.io/contacts?per_page=5", nil)
req.Header.Add("Authorization", "Bearer "+resMatch)
req.Header.Add("Accept", "application/json")
diff --git a/pkg/detectors/intrinio/intrinio.go b/pkg/detectors/intrinio/intrinio.go
index c7dd854f7..98f4e5fdb 100644
--- a/pkg/detectors/intrinio/intrinio.go
+++ b/pkg/detectors/intrinio/intrinio.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api-v2.intrinio.com/securities?api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api-v2.intrinio.com/securities?api_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/invoiceocean/invoiceocean.go b/pkg/detectors/invoiceocean/invoiceocean.go
index 01a27c719..776209f7e 100644
--- a/pkg/detectors/invoiceocean/invoiceocean.go
+++ b/pkg/detectors/invoiceocean/invoiceocean.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://%s/invoices.json?period=this_month&api_token=%s", resURL, resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s/invoices.json?period=this_month&api_token=%s", resURL, resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/ipapi/ipapi.go b/pkg/detectors/ipapi/ipapi.go
index b3d4a13d0..7c8940fbb 100644
--- a/pkg/detectors/ipapi/ipapi.go
+++ b/pkg/detectors/ipapi/ipapi.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.ipapi.com/49.146.239.251?access_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.ipapi.com/49.146.239.251?access_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/ipgeolocation/ipgeolocation.go b/pkg/detectors/ipgeolocation/ipgeolocation.go
index 5b6bc7ea8..e232ef638 100644
--- a/pkg/detectors/ipgeolocation/ipgeolocation.go
+++ b/pkg/detectors/ipgeolocation/ipgeolocation.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.ipgeolocation.io/ipgeo?apiKey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.ipgeolocation.io/ipgeo?apiKey=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/ipify/ipify.go b/pkg/detectors/ipify/ipify.go
index b134a585a..f46eb7cea 100644
--- a/pkg/detectors/ipify/ipify.go
+++ b/pkg/detectors/ipify/ipify.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://geo.ipify.org/api/v2/country?apiKey=%s&ipAddress=8.8.8.8", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://geo.ipify.org/api/v2/country?apiKey=%s&ipAddress=8.8.8.8", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/ipinfodb/ipinfodb.go b/pkg/detectors/ipinfodb/ipinfodb.go
index a3bc991a6..d73f1ceca 100644
--- a/pkg/detectors/ipinfodb/ipinfodb.go
+++ b/pkg/detectors/ipinfodb/ipinfodb.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.ipinfodb.com/v3/ip-country/?key=%s&ip=8.8.8.8&format=json", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.ipinfodb.com/v3/ip-country/?key=%s&ip=8.8.8.8&format=json", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/ipquality/ipquality.go b/pkg/detectors/ipquality/ipquality.go
index c8b153bbc..55936aef7 100644
--- a/pkg/detectors/ipquality/ipquality.go
+++ b/pkg/detectors/ipquality/ipquality.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://www.ipqualityscore.com/api/json/account/%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://www.ipqualityscore.com/api/json/account/%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/ipstack/ipstack.go b/pkg/detectors/ipstack/ipstack.go
index 4f714b975..3dc92d592 100644
--- a/pkg/detectors/ipstack/ipstack.go
+++ b/pkg/detectors/ipstack/ipstack.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.ipstack.com/134.201.250.155?access_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.ipstack.com/134.201.250.155?access_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/jiratoken/jiratoken.go b/pkg/detectors/jiratoken/jiratoken.go
index f5b5f84ba..0ab744d97 100644
--- a/pkg/detectors/jiratoken/jiratoken.go
+++ b/pkg/detectors/jiratoken/jiratoken.go
@@ -69,7 +69,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:%s", resEmail, resToken)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://"+resDomain+"/rest/api/3/dashboard", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://"+resDomain+"/rest/api/3/dashboard", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/jotform/jotform.go b/pkg/detectors/jotform/jotform.go
index acf1a19f1..7fae90f4e 100644
--- a/pkg/detectors/jotform/jotform.go
+++ b/pkg/detectors/jotform/jotform.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.jotform.com/user?apiKey="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.jotform.com/user?apiKey="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/jumpcloud/jumpcloud.go b/pkg/detectors/jumpcloud/jumpcloud.go
index 57cf63bf0..078bf6562 100644
--- a/pkg/detectors/jumpcloud/jumpcloud.go
+++ b/pkg/detectors/jumpcloud/jumpcloud.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://console.jumpcloud.com/api/v2/systemgroups", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://console.jumpcloud.com/api/v2/systemgroups", nil)
req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/juro/juro.go b/pkg/detectors/juro/juro.go
index 88152051f..4ea58b5ac 100644
--- a/pkg/detectors/juro/juro.go
+++ b/pkg/detectors/juro/juro.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.juro.com/v3/templates", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.juro.com/v3/templates", nil)
req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/kanban/kanban.go b/pkg/detectors/kanban/kanban.go
index fc42f879f..37fe1e9c6 100644
--- a/pkg/detectors/kanban/kanban.go
+++ b/pkg/detectors/kanban/kanban.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://%s/api/v3/users/current.json", resURL), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s/api/v3/users/current.json", resURL), nil)
req.Header.Add("Accept", "application/vnd.kanban+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/karmacrm/karmacrm.go b/pkg/detectors/karmacrm/karmacrm.go
index 99ff87dca..2fa93ea51 100644
--- a/pkg/detectors/karmacrm/karmacrm.go
+++ b/pkg/detectors/karmacrm/karmacrm.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://app.karmacrm.com/api/v3/contacts.json?api_token=%s&page=1", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://app.karmacrm.com/api/v3/contacts.json?api_token=%s&page=1", resMatch), nil)
req.Header.Add("Accept", "application/vnd.karmacrm+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/keenio/keenio.go b/pkg/detectors/keenio/keenio.go
index 0e54489e4..7159e1642 100644
--- a/pkg/detectors/keenio/keenio.go
+++ b/pkg/detectors/keenio/keenio.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.keen.io/3.0/organizations/"+resIdMatch+"/projects", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.keen.io/3.0/organizations/"+resIdMatch+"/projects", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/kickbox/kickbox.go b/pkg/detectors/kickbox/kickbox.go
index 9bb50faa6..617d192d5 100644
--- a/pkg/detectors/kickbox/kickbox.go
+++ b/pkg/detectors/kickbox/kickbox.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.kickbox.com/v2/[email protected]&apikey="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.kickbox.com/v2/[email protected]&apikey="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/kontent/kontent.go b/pkg/detectors/kontent/kontent.go
index c47401b72..1c480fffe 100644
--- a/pkg/detectors/kontent/kontent.go
+++ b/pkg/detectors/kontent/kontent.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://deliver.kontent.ai/%s/items", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://deliver.kontent.ai/%s/items", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/kraken/kraken.go b/pkg/detectors/kraken/kraken.go
index f18d2bd32..a5b6382b0 100644
--- a/pkg/detectors/kraken/kraken.go
+++ b/pkg/detectors/kraken/kraken.go
@@ -78,7 +78,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
b64DecodedSecret, _ := base64.StdEncoding.DecodeString(resPrivKeyMatch)
signature := getKrakenSignature("/0/private/Balance", payload, b64DecodedSecret)
- req, _ := http.NewRequest("POST", "https://api.kraken.com/0/private/Balance", strings.NewReader(payload.Encode()))
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.kraken.com/0/private/Balance", strings.NewReader(payload.Encode()))
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("API-Key", resMatch)
req.Header.Add("API-Sign", signature)
diff --git a/pkg/detectors/kylas/kylas.go b/pkg/detectors/kylas/kylas.go
index 4221ba81f..86df8f0b6 100644
--- a/pkg/detectors/kylas/kylas.go
+++ b/pkg/detectors/kylas/kylas.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.kylas.io/v1/contacts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.kylas.io/v1/contacts", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("api-key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/languagelayer/languagelayer.go b/pkg/detectors/languagelayer/languagelayer.go
index 16ba43cd2..1393d8920 100644
--- a/pkg/detectors/languagelayer/languagelayer.go
+++ b/pkg/detectors/languagelayer/languagelayer.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.languagelayer.com/languages?access_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.languagelayer.com/languages?access_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/lastfm/lastfm.go b/pkg/detectors/lastfm/lastfm.go
index ee72205a5..b610c5c5c 100644
--- a/pkg/detectors/lastfm/lastfm.go
+++ b/pkg/detectors/lastfm/lastfm.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "http://ws.audioscrobbler.com/2.0/?method=artist.getSimilar&api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "http://ws.audioscrobbler.com/2.0/?method=artist.getSimilar&api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/launchdarkly/launchdarkly.go b/pkg/detectors/launchdarkly/launchdarkly.go
index a9c3749c4..484b1f167 100644
--- a/pkg/detectors/launchdarkly/launchdarkly.go
+++ b/pkg/detectors/launchdarkly/launchdarkly.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.launchdarkly.com/api/v2/tokens", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.launchdarkly.com/api/v2/tokens", nil)
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/leadfeeder/leadfeeder.go b/pkg/detectors/leadfeeder/leadfeeder.go
index 6c861a7d4..8a9cb2e44 100644
--- a/pkg/detectors/leadfeeder/leadfeeder.go
+++ b/pkg/detectors/leadfeeder/leadfeeder.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.leadfeeder.com/accounts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.leadfeeder.com/accounts", nil)
req.Header.Add("Authorization", fmt.Sprintf("Token token=%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/lessannoyingcrm/lessannoyingcrm.go b/pkg/detectors/lessannoyingcrm/lessannoyingcrm.go
index 24b8bdb99..f2c3b6ee7 100644
--- a/pkg/detectors/lessannoyingcrm/lessannoyingcrm.go
+++ b/pkg/detectors/lessannoyingcrm/lessannoyingcrm.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
userCode := strings.Split(resMatch, "-")
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.lessannoyingcrm.com?UserCode=%s&APIToken=%s&Function=GetUserInfo", userCode, resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.lessannoyingcrm.com?UserCode=%s&APIToken=%s&Function=GetUserInfo", userCode, resMatch), nil)
req.Header.Add("Accept", "application/vnd.lessannoyingcrm+json; version=3")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/lexigram/lexigram.go b/pkg/detectors/lexigram/lexigram.go
index df143a190..8afb112fa 100644
--- a/pkg/detectors/lexigram/lexigram.go
+++ b/pkg/detectors/lexigram/lexigram.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.lexigram.io/v1/lexigraph/search?q=diabetes", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.lexigram.io/v1/lexigraph/search?q=diabetes", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/linearapi/linearapi.go b/pkg/detectors/linearapi/linearapi.go
index 104be36e7..78ecbd2c3 100644
--- a/pkg/detectors/linearapi/linearapi.go
+++ b/pkg/detectors/linearapi/linearapi.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
reqDataQuery := strings.NewReader(`{ "query": "{ viewer { id name } }" }`)
- req, _ := http.NewRequest("POST", "https://api.linear.app/graphql", reqDataQuery)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.linear.app/graphql", reqDataQuery)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", resMatch)
diff --git a/pkg/detectors/linemessaging/linemessaging.go b/pkg/detectors/linemessaging/linemessaging.go
index a110f1703..e33536d19 100644
--- a/pkg/detectors/linemessaging/linemessaging.go
+++ b/pkg/detectors/linemessaging/linemessaging.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.line.me/v2/bot/info", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.line.me/v2/bot/info", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/linenotify/linenotify.go b/pkg/detectors/linenotify/linenotify.go
index 99a65df22..cb550179a 100644
--- a/pkg/detectors/linenotify/linenotify.go
+++ b/pkg/detectors/linenotify/linenotify.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("POST", "https://notify-api.line.me/api/notify?message=Notification Successful", nil)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://notify-api.line.me/api/notify?message=Notification Successful", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/linkpreview/linkpreview.go b/pkg/detectors/linkpreview/linkpreview.go
index 89084549f..042ab6351 100644
--- a/pkg/detectors/linkpreview/linkpreview.go
+++ b/pkg/detectors/linkpreview/linkpreview.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.linkpreview.net/?key=%s&q=http://google.com", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.linkpreview.net/?key=%s&q=http://google.com", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/liveagent/liveagent.go b/pkg/detectors/liveagent/liveagent.go
index 5ad90bc9d..f0399c39c 100644
--- a/pkg/detectors/liveagent/liveagent.go
+++ b/pkg/detectors/liveagent/liveagent.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://secretscanner.ladesk.com/api/v3/agents", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://secretscanner.ladesk.com/api/v3/agents", nil)
req.Header.Add("apikey", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/lob/lob.go b/pkg/detectors/lob/lob.go
index cbd63f0d2..e0062bd49 100644
--- a/pkg/detectors/lob/lob.go
+++ b/pkg/detectors/lob/lob.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.lob.com/v1/addresses", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.lob.com/v1/addresses", nil)
req.SetBasicAuth(resMatch, "")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/locationiq/locationiq.go b/pkg/detectors/locationiq/locationiq.go
index eafd3435e..cb16290dd 100644
--- a/pkg/detectors/locationiq/locationiq.go
+++ b/pkg/detectors/locationiq/locationiq.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://us1.locationiq.com/v1/reverse.php?key="+resMatch+"&lat=-37.870662&lon=144.9803321&format=json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://us1.locationiq.com/v1/reverse.php?key="+resMatch+"&lat=-37.870662&lon=144.9803321&format=json", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/loginradius/loginradius.go b/pkg/detectors/loginradius/loginradius.go
index eccbff102..35dea4eb0 100644
--- a/pkg/detectors/loginradius/loginradius.go
+++ b/pkg/detectors/loginradius/loginradius.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.loginradius.com/identity/v2/serverinfo?apikey="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.loginradius.com/identity/v2/serverinfo?apikey="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/lokalisetoken/lokalisetoken.go b/pkg/detectors/lokalisetoken/lokalisetoken.go
index c79046afe..aa1463e37 100644
--- a/pkg/detectors/lokalisetoken/lokalisetoken.go
+++ b/pkg/detectors/lokalisetoken/lokalisetoken.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.lokalise.com/api2/system/languages", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.lokalise.com/api2/system/languages", nil)
req.Header.Add("x-api-token", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/loyverse/loyverse.go b/pkg/detectors/loyverse/loyverse.go
index 9b70fba31..ab6f3a639 100644
--- a/pkg/detectors/loyverse/loyverse.go
+++ b/pkg/detectors/loyverse/loyverse.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.loyverse.com/v1.0/merchant/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.loyverse.com/v1.0/merchant/", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/luno/luno.go b/pkg/detectors/luno/luno.go
index f40468b5f..7d447f09b 100644
--- a/pkg/detectors/luno/luno.go
+++ b/pkg/detectors/luno/luno.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.luno.com/api/1/balance", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.luno.com/api/1/balance", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/m3o/m3o.go b/pkg/detectors/m3o/m3o.go
index b94d67006..99ea9d3cc 100644
--- a/pkg/detectors/m3o/m3o.go
+++ b/pkg/detectors/m3o/m3o.go
@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
"days": 2,
"location": "London"
}`)
- req, _ := http.NewRequest("POST", "https://api.m3o.com/v1/weather/Forecast", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.m3o.com/v1/weather/Forecast", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/macaddress/macaddress.go b/pkg/detectors/macaddress/macaddress.go
index cc40fb043..66e3a277d 100644
--- a/pkg/detectors/macaddress/macaddress.go
+++ b/pkg/detectors/macaddress/macaddress.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.macaddress.io/v1?apiKey=%s&output=json&search=44:38:39:ff:ef:51", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.macaddress.io/v1?apiKey=%s&output=json&search=44:38:39:ff:ef:51", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/magnetic/magnetic.go b/pkg/detectors/magnetic/magnetic.go
index f67215cf7..4a8f11990 100644
--- a/pkg/detectors/magnetic/magnetic.go
+++ b/pkg/detectors/magnetic/magnetic.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.magnetichq.com/Magnetic/rest/accountsAPI/itemTypes?token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.magnetichq.com/Magnetic/rest/accountsAPI/itemTypes?token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/mailboxlayer/mailboxlayer.go b/pkg/detectors/mailboxlayer/mailboxlayer.go
index 48f1c2744..916f759c6 100644
--- a/pkg/detectors/mailboxlayer/mailboxlayer.go
+++ b/pkg/detectors/mailboxlayer/mailboxlayer.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "http://apilayer.net/api/check?access_key="+resMatch+"&[email protected]", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "http://apilayer.net/api/check?access_key="+resMatch+"&[email protected]", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/mailchimp/mailchimp.go b/pkg/detectors/mailchimp/mailchimp.go
index 9eca6f3d9..a2a73be72 100644
--- a/pkg/detectors/mailchimp/mailchimp.go
+++ b/pkg/detectors/mailchimp/mailchimp.go
@@ -48,7 +48,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
client := common.SaneHttpClient()
// https://mailchimp.com/developer/guides/marketing-api-conventions/
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://%s.api.mailchimp.com/3.0/", datacenter), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s.api.mailchimp.com/3.0/", datacenter), nil)
req.SetBasicAuth("anystring", match)
res, err := client.Do(req)
if err != nil {
diff --git a/pkg/detectors/mailerlite/mailerlite.go b/pkg/detectors/mailerlite/mailerlite.go
index f2caba644..ead6591d9 100644
--- a/pkg/detectors/mailerlite/mailerlite.go
+++ b/pkg/detectors/mailerlite/mailerlite.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.mailerlite.com/api/v2/campaigns", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.mailerlite.com/api/v2/campaigns", nil)
req.Header.Add("X-MailerLite-ApiKey", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/mailgun/mailgun.go b/pkg/detectors/mailgun/mailgun.go
index aac93b216..f9d1d18b2 100644
--- a/pkg/detectors/mailgun/mailgun.go
+++ b/pkg/detectors/mailgun/mailgun.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.mailgun.net/v3/domains", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.mailgun.net/v3/domains", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/mailjetbasicauth/mailjetbasicauth.go b/pkg/detectors/mailjetbasicauth/mailjetbasicauth.go
index 83318c1fb..0fe0ca8cc 100644
--- a/pkg/detectors/mailjetbasicauth/mailjetbasicauth.go
+++ b/pkg/detectors/mailjetbasicauth/mailjetbasicauth.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.mailjet.com/v3/REST/message", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.mailjet.com/v3/REST/message", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/mailjetsms/mailjetsms.go b/pkg/detectors/mailjetsms/mailjetsms.go
index f5c5b726e..a018e1a75 100644
--- a/pkg/detectors/mailjetsms/mailjetsms.go
+++ b/pkg/detectors/mailjetsms/mailjetsms.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.mailjet.com/v4/sms", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.mailjet.com/v4/sms", nil)
req.Header.Add("Accept", "application/vnd.mailjetsms+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/mailmodo/mailmodo.go b/pkg/detectors/mailmodo/mailmodo.go
index c3b213385..1107226d7 100644
--- a/pkg/detectors/mailmodo/mailmodo.go
+++ b/pkg/detectors/mailmodo/mailmodo.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.mailmodo.com/api/v1/campaigns?type=CONTACT_LIST", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.mailmodo.com/api/v1/campaigns?type=CONTACT_LIST", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("mmApiKey", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/mailsac/mailsac.go b/pkg/detectors/mailsac/mailsac.go
index d3b8e7db1..501626bb2 100644
--- a/pkg/detectors/mailsac/mailsac.go
+++ b/pkg/detectors/mailsac/mailsac.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://mailsac.com/api/addresses", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://mailsac.com/api/addresses", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Mailsac-Key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/mandrill/mandrill.go b/pkg/detectors/mandrill/mandrill.go
index 1835d03e8..b0d500665 100644
--- a/pkg/detectors/mandrill/mandrill.go
+++ b/pkg/detectors/mandrill/mandrill.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(fmt.Sprintf(`{"key": "%s"}`, resMatch))
- req, _ := http.NewRequest("POST", "https://mandrillapp.com/api/1.0/users/info", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://mandrillapp.com/api/1.0/users/info", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/manifest/manifest.go b/pkg/detectors/manifest/manifest.go
index d77c981bf..efe18e47d 100644
--- a/pkg/detectors/manifest/manifest.go
+++ b/pkg/detectors/manifest/manifest.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.manifest.ly/api/v1/checklists/?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.manifest.ly/api/v1/checklists/?api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/mapbox/mapbox.go b/pkg/detectors/mapbox/mapbox.go
index bbf3cd83b..51b651682 100644
--- a/pkg/detectors/mapbox/mapbox.go
+++ b/pkg/detectors/mapbox/mapbox.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.mapbox.com/tokens/v2/"+resId+"?access_token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.mapbox.com/tokens/v2/"+resId+"?access_token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/mapquest/mapquest.go b/pkg/detectors/mapquest/mapquest.go
index 66c3f7582..c534f160a 100644
--- a/pkg/detectors/mapquest/mapquest.go
+++ b/pkg/detectors/mapquest/mapquest.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "http://www.mapquestapi.com/datamanager/v2/get-column-types?key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "http://www.mapquestapi.com/datamanager/v2/get-column-types?key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/marketstack/marketstack.go b/pkg/detectors/marketstack/marketstack.go
index 17b29fb8e..5dc7cee74 100644
--- a/pkg/detectors/marketstack/marketstack.go
+++ b/pkg/detectors/marketstack/marketstack.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.marketstack.com/v1/eod?access_key=%s&symbols=AAPL", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.marketstack.com/v1/eod?access_key=%s&symbols=AAPL", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go b/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go
index cebf522d6..b8421ea99 100644
--- a/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go
+++ b/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://"+serverRes+"/api/v4/users/stats", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://"+serverRes+"/api/v4/users/stats", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/mavenlink/mavenlink.go b/pkg/detectors/mavenlink/mavenlink.go
index fee59d2ff..b9c556390 100644
--- a/pkg/detectors/mavenlink/mavenlink.go
+++ b/pkg/detectors/mavenlink/mavenlink.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.mavenlink.com/api/v1/workspaces.json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.mavenlink.com/api/v1/workspaces.json", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/maxmindlicense/maxmindlicense.go b/pkg/detectors/maxmindlicense/maxmindlicense.go
index bca9b1dcb..787494795 100644
--- a/pkg/detectors/maxmindlicense/maxmindlicense.go
+++ b/pkg/detectors/maxmindlicense/maxmindlicense.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://geoip.maxmind.com/geoip/v2.1/country/8.8.8.8", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://geoip.maxmind.com/geoip/v2.1/country/8.8.8.8", nil)
req.SetBasicAuth(idRes, keyRes)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/meaningcloud/meaningcloud.go b/pkg/detectors/meaningcloud/meaningcloud.go
index a6d2317cd..b1d0e6deb 100644
--- a/pkg/detectors/meaningcloud/meaningcloud.go
+++ b/pkg/detectors/meaningcloud/meaningcloud.go
@@ -72,7 +72,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
writer.Close()
- req, _ := http.NewRequest("POST", "https://api.meaningcloud.com/lang-4.0/identification", bytes.NewReader(body.Bytes()))
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.meaningcloud.com/lang-4.0/identification", bytes.NewReader(body.Bytes()))
req.Header.Add("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/mediastack/mediastack.go b/pkg/detectors/mediastack/mediastack.go
index db91ea5c6..d0f897e5f 100644
--- a/pkg/detectors/mediastack/mediastack.go
+++ b/pkg/detectors/mediastack/mediastack.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.mediastack.com/v1/news?access_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.mediastack.com/v1/news?access_key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/meistertask/meistertask.go b/pkg/detectors/meistertask/meistertask.go
index 095a3976b..5c90d68d2 100644
--- a/pkg/detectors/meistertask/meistertask.go
+++ b/pkg/detectors/meistertask/meistertask.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.meistertask.com/api/projects", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.meistertask.com/api/projects", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/mesibo/mesibo.go b/pkg/detectors/mesibo/mesibo.go
index 3fd3dc949..9107adfb6 100644
--- a/pkg/detectors/mesibo/mesibo.go
+++ b/pkg/detectors/mesibo/mesibo.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.mesibo.com/api.php?op=useradd&token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.mesibo.com/api.php?op=useradd&token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/messagebird/messagebird.go b/pkg/detectors/messagebird/messagebird.go
index 17833d859..4ecad45d1 100644
--- a/pkg/detectors/messagebird/messagebird.go
+++ b/pkg/detectors/messagebird/messagebird.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://rest.messagebird.com/messages", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://rest.messagebird.com/messages", nil)
req.Header.Add("Authorization", fmt.Sprintf("AccessKey %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/metrilo/metrilo.go b/pkg/detectors/metrilo/metrilo.go
index 5929763cb..210c1dce4 100644
--- a/pkg/detectors/metrilo/metrilo.go
+++ b/pkg/detectors/metrilo/metrilo.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"time":1518004715732,"token": "` + resMatch + `" ,"platform":"Wordpress 4.2.7 / Woocommerce 3.5","pluginVersion":"1.1.0","params":{"id":"12","name":"Clothing","url":"https://dummysite.com"}}`)
- req, _ := http.NewRequest("POST", "https://trk.mtrl.me/category", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://trk.mtrl.me/category", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Content-Length", `0`)
res, err := client.Do(req)
diff --git a/pkg/detectors/microsoftteamswebhook/microsoftteamswebhook.go b/pkg/detectors/microsoftteamswebhook/microsoftteamswebhook.go
index 165403b19..2d189f193 100644
--- a/pkg/detectors/microsoftteamswebhook/microsoftteamswebhook.go
+++ b/pkg/detectors/microsoftteamswebhook/microsoftteamswebhook.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
payload := strings.NewReader(`{'text':'This is a verification message from TruffleHog. It means that there has been a live webhook credential found.'}`)
- req, _ := http.NewRequest("POST", resMatch, payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", resMatch, payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
diff --git a/pkg/detectors/mindmeister/mindmeister.go b/pkg/detectors/mindmeister/mindmeister.go
index d3853c391..ba99a102a 100644
--- a/pkg/detectors/mindmeister/mindmeister.go
+++ b/pkg/detectors/mindmeister/mindmeister.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.mindmeister.com/services/rest/oauth2?method=mm.maps.getList", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.mindmeister.com/services/rest/oauth2?method=mm.maps.getList", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/mite/mite.go b/pkg/detectors/mite/mite.go
index 4f4f8000b..d3dda8c8c 100644
--- a/pkg/detectors/mite/mite.go
+++ b/pkg/detectors/mite/mite.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://%s/account.json", resURL), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s/account.json", resURL), nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-MiteApiKey", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/mixmax/mixmax.go b/pkg/detectors/mixmax/mixmax.go
index 187650c20..574856a97 100644
--- a/pkg/detectors/mixmax/mixmax.go
+++ b/pkg/detectors/mixmax/mixmax.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.mixmax.com/v1/users/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.mixmax.com/v1/users/me", nil)
req.Header.Add("X-API-Token", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/mixpanel/mixpanel.go b/pkg/detectors/mixpanel/mixpanel.go
index ee1423ada..a6f7f1960 100644
--- a/pkg/detectors/mixpanel/mixpanel.go
+++ b/pkg/detectors/mixpanel/mixpanel.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://mixpanel.com/api/app/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://mixpanel.com/api/app/me", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/monday/monday.go b/pkg/detectors/monday/monday.go
index d8ec0f28f..2381f2fd0 100644
--- a/pkg/detectors/monday/monday.go
+++ b/pkg/detectors/monday/monday.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"query":"{boards(limit:1){id name}}"}`)
- req, _ := http.NewRequest("POST", "https://api.monday.com/v2", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.monday.com/v2", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/moonclerk/moonclerk.go b/pkg/detectors/moonclerk/moonclerk.go
index 07876807b..a14aab2f3 100644
--- a/pkg/detectors/moonclerk/moonclerk.go
+++ b/pkg/detectors/moonclerk/moonclerk.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.moonclerk.com/forms", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.moonclerk.com/forms", nil)
req.Header.Add("Accept", "application/vnd.moonclerk+json;version=1")
req.Header.Add("Authorization", "Token token="+resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/moosend/moosend.go b/pkg/detectors/moosend/moosend.go
index 2956944c8..a39f605e7 100644
--- a/pkg/detectors/moosend/moosend.go
+++ b/pkg/detectors/moosend/moosend.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.moosend.com/v3/lists.json?apikey="+resMatch+"&format=json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.moosend.com/v3/lists.json?apikey="+resMatch+"&format=json", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/mrticktock/mrticktock.go b/pkg/detectors/mrticktock/mrticktock.go
index 372832a5b..b97452ae6 100644
--- a/pkg/detectors/mrticktock/mrticktock.go
+++ b/pkg/detectors/mrticktock/mrticktock.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(fmt.Sprintf(`email=%s&password=%s`, resMatch, resPassword))
- req, _ := http.NewRequest("POST", "https://mrticktock.com/app/api/is_timer_active", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://mrticktock.com/app/api/is_timer_active", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/myfreshworks/myfreshworks.go b/pkg/detectors/myfreshworks/myfreshworks.go
index 4fe2f895c..3fa4a2fb6 100644
--- a/pkg/detectors/myfreshworks/myfreshworks.go
+++ b/pkg/detectors/myfreshworks/myfreshworks.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://"+resIdMatch+".myfreshworks.com/crm/sales/api/sales_accounts/filters", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://"+resIdMatch+".myfreshworks.com/crm/sales/api/sales_accounts/filters", nil)
req.Header.Add("Authorization", fmt.Sprintf("Token token=%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/myintervals/myintervals.go b/pkg/detectors/myintervals/myintervals.go
index e8467393a..644f03954 100644
--- a/pkg/detectors/myintervals/myintervals.go
+++ b/pkg/detectors/myintervals/myintervals.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:X", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.myintervals.com/client/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.myintervals.com/client/", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/nasdaqdatalink/nasdaqdatalink.go b/pkg/detectors/nasdaqdatalink/nasdaqdatalink.go
index 672da8acb..a5ee2e967 100644
--- a/pkg/detectors/nasdaqdatalink/nasdaqdatalink.go
+++ b/pkg/detectors/nasdaqdatalink/nasdaqdatalink.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://data.nasdaq.com/api/v3/datasets/FRED/GDP.csv?api_key=%s&collapse=annual&rows=6&order=asc&column_index=1", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://data.nasdaq.com/api/v3/datasets/FRED/GDP.csv?api_key=%s&collapse=annual&rows=6&order=asc&column_index=1", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/nethunt/nethunt.go b/pkg/detectors/nethunt/nethunt.go
index 4f396dd97..12799bc98 100644
--- a/pkg/detectors/nethunt/nethunt.go
+++ b/pkg/detectors/nethunt/nethunt.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://nethunt.com/api/v1/zapier/triggers/readable-folder", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://nethunt.com/api/v1/zapier/triggers/readable-folder", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/netlify/netlify.go b/pkg/detectors/netlify/netlify.go
index ae1ef6705..f65af7b77 100644
--- a/pkg/detectors/netlify/netlify.go
+++ b/pkg/detectors/netlify/netlify.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.netlify.com/api/v1/sites", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.netlify.com/api/v1/sites", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/neutrinoapi/neutrinoapi.go b/pkg/detectors/neutrinoapi/neutrinoapi.go
index f3704fc2d..12168d409 100644
--- a/pkg/detectors/neutrinoapi/neutrinoapi.go
+++ b/pkg/detectors/neutrinoapi/neutrinoapi.go
@@ -74,7 +74,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
writer.Close()
- req, _ := http.NewRequest("POST", fmt.Sprintf("https://neutrinoapi.net/url-info?user-id=%s&api-key=%s", resIdMatch, resMatch), bytes.NewReader(body.Bytes()))
+ req, _ := http.NewRequestWithContext(ctx, "POST", fmt.Sprintf("https://neutrinoapi.net/url-info?user-id=%s&api-key=%s", resIdMatch, resMatch), bytes.NewReader(body.Bytes()))
req.Header.Add("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go b/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go
index 77247fd81..458906425 100644
--- a/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go
+++ b/pkg/detectors/newrelicpersonalapikey/newrelicpersonalapikey.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.newrelic.com/v2/users.json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.newrelic.com/v2/users.json", nil)
req.Header.Add("X-Api-Key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/newsapi/newsapi.go b/pkg/detectors/newsapi/newsapi.go
index b1bc11c5e..9d14f8787 100644
--- a/pkg/detectors/newsapi/newsapi.go
+++ b/pkg/detectors/newsapi/newsapi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://newsapi.org/v2/everything?q=Apple&from=2021-09-29&sortBy=popularity&apiKey="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://newsapi.org/v2/everything?q=Apple&from=2021-09-29&sortBy=popularity&apiKey="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/newscatcher/newscatcher.go b/pkg/detectors/newscatcher/newscatcher.go
index aa6e3387f..394ec5d53 100644
--- a/pkg/detectors/newscatcher/newscatcher.go
+++ b/pkg/detectors/newscatcher/newscatcher.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.newscatcherapi.com/v2/search?q=Tesla", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.newscatcherapi.com/v2/search?q=Tesla", nil)
req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/nexmoapikey/nexmoapikey.go b/pkg/detectors/nexmoapikey/nexmoapikey.go
index 1435ca4bf..ea9cb07cd 100644
--- a/pkg/detectors/nexmoapikey/nexmoapikey.go
+++ b/pkg/detectors/nexmoapikey/nexmoapikey.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://rest.nexmo.com/account/get-balance?api_key="+resMatch+"&api_secret="+resSecret+"", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://rest.nexmo.com/account/get-balance?api_key="+resMatch+"&api_secret="+resSecret+"", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/nftport/nftport.go b/pkg/detectors/nftport/nftport.go
index fec06d199..950c6e271 100644
--- a/pkg/detectors/nftport/nftport.go
+++ b/pkg/detectors/nftport/nftport.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.nftport.xyz/me/contracts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.nftport.xyz/me/contracts", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/nicereply/nicereply.go b/pkg/detectors/nicereply/nicereply.go
index a63446bbb..f8a9fae59 100644
--- a/pkg/detectors/nicereply/nicereply.go
+++ b/pkg/detectors/nicereply/nicereply.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf(":%s", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.nicereply.com/v1/users/stats", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.nicereply.com/v1/users/stats", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/nimble/nimble.go b/pkg/detectors/nimble/nimble.go
index 9694413c1..d28fecdd1 100644
--- a/pkg/detectors/nimble/nimble.go
+++ b/pkg/detectors/nimble/nimble.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.nimble.com/api/v1/myself", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.nimble.com/api/v1/myself", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/nitro/nitro.go b/pkg/detectors/nitro/nitro.go
index 0ef3a3741..968e53a8e 100644
--- a/pkg/detectors/nitro/nitro.go
+++ b/pkg/detectors/nitro/nitro.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://nitro.alconost.com/api/v1/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://nitro.alconost.com/api/v1/account", nil)
req.Header.Add("Content-Type", "application/json")
req.SetBasicAuth(resMatch, "")
res, err := client.Do(req)
diff --git a/pkg/detectors/noticeable/noticeable.go b/pkg/detectors/noticeable/noticeable.go
index 5b9c4d8bd..b4f8d5545 100644
--- a/pkg/detectors/noticeable/noticeable.go
+++ b/pkg/detectors/noticeable/noticeable.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"query": "YOUR_GRAPHQL_PAYLOAD"}`)
- req, _ := http.NewRequest("POST", "https://api.noticeable.io/graphql", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.noticeable.io/graphql", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Apikey %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/notion/notion.go b/pkg/detectors/notion/notion.go
index c3405129c..2451f94b8 100644
--- a/pkg/detectors/notion/notion.go
+++ b/pkg/detectors/notion/notion.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.notion.com/v1/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.notion.com/v1/users", nil)
req.Header.Add("Notion-Version", "2021-05-11")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/numverify/numverify.go b/pkg/detectors/numverify/numverify.go
index c54de59a8..099a344b9 100644
--- a/pkg/detectors/numverify/numverify.go
+++ b/pkg/detectors/numverify/numverify.go
@@ -47,7 +47,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(resMatch),
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://apilayer.net/api/validate?access_key=%s&number=14158586273", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://apilayer.net/api/validate?access_key=%s&number=14158586273", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/nutritionix/nutritionix.go b/pkg/detectors/nutritionix/nutritionix.go
index 3af401708..73d4e371d 100644
--- a/pkg/detectors/nutritionix/nutritionix.go
+++ b/pkg/detectors/nutritionix/nutritionix.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"query":"for breakfast i ate 2 eggs, bacon, and french toast","timezone":"US/Eastern"}`)
- req, _ := http.NewRequest("POST", "https://trackapi.nutritionix.com/v2/natural/nutrients", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://trackapi.nutritionix.com/v2/natural/nutrients", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-app-id", resIdMatch)
req.Header.Add("x-app-key", resMatch)
diff --git a/pkg/detectors/nylas/nylas.go b/pkg/detectors/nylas/nylas.go
index 965ac65bb..8dcf53123 100644
--- a/pkg/detectors/nylas/nylas.go
+++ b/pkg/detectors/nylas/nylas.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.nylas.com/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.nylas.com/account", nil)
req.Header.Add("Accept", "application/vnd.nylas+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/nytimes/nytimes.go b/pkg/detectors/nytimes/nytimes.go
index 0b70f4eea..7883c0054 100644
--- a/pkg/detectors/nytimes/nytimes.go
+++ b/pkg/detectors/nytimes/nytimes.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.nytimes.com/svc/archive/v1/2019/1.json?api-key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.nytimes.com/svc/archive/v1/2019/1.json?api-key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/oanda/oanda.go b/pkg/detectors/oanda/oanda.go
index 9fcf30017..551b5c37f 100644
--- a/pkg/detectors/oanda/oanda.go
+++ b/pkg/detectors/oanda/oanda.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://web-services.oanda.com/rates/api/v2/currencies.json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://web-services.oanda.com/rates/api/v2/currencies.json", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/okta/okta.go b/pkg/detectors/okta/okta.go
index f0270fbf3..41eebc97b 100644
--- a/pkg/detectors/okta/okta.go
+++ b/pkg/detectors/okta/okta.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
//
url := fmt.Sprintf("https://%s/api/v1/groups?limit=1", domain)
- req, err := http.NewRequest("GET", url, nil)
+ req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
if err != nil {
return results, err
}
diff --git a/pkg/detectors/omnisend/omnisend.go b/pkg/detectors/omnisend/omnisend.go
index 5d3c2db85..70e8195d0 100644
--- a/pkg/detectors/omnisend/omnisend.go
+++ b/pkg/detectors/omnisend/omnisend.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.omnisend.com/v3/contacts?limit=100&offset=0", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.omnisend.com/v3/contacts?limit=100&offset=0", nil)
req.Header.Add("X-API-KEY", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/onedesk/onedesk.go b/pkg/detectors/onedesk/onedesk.go
index e24fbfa94..3263998fe 100644
--- a/pkg/detectors/onedesk/onedesk.go
+++ b/pkg/detectors/onedesk/onedesk.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(fmt.Sprintf(`{"email": "%s", "password": "%s"}`, resMatch, resPword))
- req, _ := http.NewRequest("POST", "https://app.onedesk.com/rest/2.0/login/loginUser", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://app.onedesk.com/rest/2.0/login/loginUser", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/onepagecrm/onepagecrm.go b/pkg/detectors/onepagecrm/onepagecrm.go
index e8595fc4d..264e702f5 100644
--- a/pkg/detectors/onepagecrm/onepagecrm.go
+++ b/pkg/detectors/onepagecrm/onepagecrm.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(tokenPatMatch),
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.onepagecrm.com/api/v3/contacts.json?per_page=20&page=1", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.onepagecrm.com/api/v3/contacts.json?per_page=20&page=1", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/onwaterio/onwaterio.go b/pkg/detectors/onwaterio/onwaterio.go
index b036d9920..108d5a8c5 100644
--- a/pkg/detectors/onwaterio/onwaterio.go
+++ b/pkg/detectors/onwaterio/onwaterio.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.onwater.io/api/v1/results/23.92323,-66.3?access_token=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.onwater.io/api/v1/results/23.92323,-66.3?access_token=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/oopspam/oopspam.go b/pkg/detectors/oopspam/oopspam.go
index ee9d0b704..3d43dcb27 100644
--- a/pkg/detectors/oopspam/oopspam.go
+++ b/pkg/detectors/oopspam/oopspam.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"checkForLength":true,"content":"Dear Agent, We are a manufacturing company which specializes in supplying Aluminum Rod with Zinc Alloy Rod to customers worldwide, based in Japan, Asia. We have been unable to follow up payments effectively for transactions with debtor customers in your country due to our distant locations, thus our reason for requesting for your services representation.","senderIP":"185.234.219.246","allowedCountries":["it","us"],"allowedLanguages":["en"]}`)
- req, _ := http.NewRequest("POST", "https://api.oopspam.com/v1/spamdetection", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.oopspam.com/v1/spamdetection", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-Api-Key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/opencagedata/opencagedata.go b/pkg/detectors/opencagedata/opencagedata.go
index 70e71b55d..cddcc4f5c 100644
--- a/pkg/detectors/opencagedata/opencagedata.go
+++ b/pkg/detectors/opencagedata/opencagedata.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.opencagedata.com/geocode/v1/json?q=12.8797,121.7740&key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.opencagedata.com/geocode/v1/json?q=12.8797,121.7740&key=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/opengraphr/opengraphr.go b/pkg/detectors/opengraphr/opengraphr.go
index 8a88031df..72f93694b 100644
--- a/pkg/detectors/opengraphr/opengraphr.go
+++ b/pkg/detectors/opengraphr/opengraphr.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.opengraphr.com/v1/og?api_token="+resMatch+"&url=http://www.marlonpamisa.com/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.opengraphr.com/v1/og?api_token="+resMatch+"&url=http://www.marlonpamisa.com/", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/openuv/openuv.go b/pkg/detectors/openuv/openuv.go
index 9ba3d732d..d671f5a7d 100644
--- a/pkg/detectors/openuv/openuv.go
+++ b/pkg/detectors/openuv/openuv.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.openuv.io/api/v1/uv?lat=-33.34&lng=115.342", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.openuv.io/api/v1/uv?lat=-33.34&lng=115.342", nil)
req.Header.Add("x-access-token", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/openweather/openweather.go b/pkg/detectors/openweather/openweather.go
index ea79b897a..24ea96787 100644
--- a/pkg/detectors/openweather/openweather.go
+++ b/pkg/detectors/openweather/openweather.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "http://api.openweathermap.org/data/2.5/weather?id=524901&lang=fr&appid="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "http://api.openweathermap.org/data/2.5/weather?id=524901&lang=fr&appid="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/optimizely/optimizely.go b/pkg/detectors/optimizely/optimizely.go
index 47f06ba83..06c7c6434 100644
--- a/pkg/detectors/optimizely/optimizely.go
+++ b/pkg/detectors/optimizely/optimizely.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.optimizely.com/v2/projects", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.optimizely.com/v2/projects", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/owlbot/owlbot.go b/pkg/detectors/owlbot/owlbot.go
index 5b901b790..598695d24 100644
--- a/pkg/detectors/owlbot/owlbot.go
+++ b/pkg/detectors/owlbot/owlbot.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://owlbot.info/api/v4/dictionary/security", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://owlbot.info/api/v4/dictionary/security", nil)
req.Header.Add("Authorization", fmt.Sprintf("Token %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/pagerdutyapikey/pagerdutyapikey.go b/pkg/detectors/pagerdutyapikey/pagerdutyapikey.go
index 4bd67a670..ee83d99b4 100644
--- a/pkg/detectors/pagerdutyapikey/pagerdutyapikey.go
+++ b/pkg/detectors/pagerdutyapikey/pagerdutyapikey.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.pagerduty.com/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.pagerduty.com/users", nil)
req.Header.Add("Accept", "application/vnd.pagerduty+json;version=2")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Token %s", resMatch))
diff --git a/pkg/detectors/pandadoc/pandadoc.go b/pkg/detectors/pandadoc/pandadoc.go
index 1a57fa14c..e58e80c35 100644
--- a/pkg/detectors/pandadoc/pandadoc.go
+++ b/pkg/detectors/pandadoc/pandadoc.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.pandadoc.com/public/v1/documents", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.pandadoc.com/public/v1/documents", nil)
req.Header.Add("Authorization", fmt.Sprintf("API-Key %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/paralleldots/paralleldots.go b/pkg/detectors/paralleldots/paralleldots.go
index d687b3026..83cc5c99a 100644
--- a/pkg/detectors/paralleldots/paralleldots.go
+++ b/pkg/detectors/paralleldots/paralleldots.go
@@ -73,7 +73,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
writer.Close()
- req, _ := http.NewRequest("POST", "https://apis.paralleldots.com/v4/intent", bytes.NewReader(payload.Bytes()))
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://apis.paralleldots.com/v4/intent", bytes.NewReader(payload.Bytes()))
req.Header.Add("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/partnerstack/partnerstack.go b/pkg/detectors/partnerstack/partnerstack.go
index b9ef9cfd6..8ad5e0129 100644
--- a/pkg/detectors/partnerstack/partnerstack.go
+++ b/pkg/detectors/partnerstack/partnerstack.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.partnerstack.com/api/v2/partnerships", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.partnerstack.com/api/v2/partnerships", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/passbase/passbase.go b/pkg/detectors/passbase/passbase.go
index c9584a038..71419b1ae 100644
--- a/pkg/detectors/passbase/passbase.go
+++ b/pkg/detectors/passbase/passbase.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.passbase.com/verification/v1/settings", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.passbase.com/verification/v1/settings", nil)
req.Header.Add("X-API-KEY", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/pastebin/pastebin.go b/pkg/detectors/pastebin/pastebin.go
index dfc9c5d33..b811c112d 100644
--- a/pkg/detectors/pastebin/pastebin.go
+++ b/pkg/detectors/pastebin/pastebin.go
@@ -80,7 +80,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
writer.Close()
- req, _ := http.NewRequest("POST", "https://pastebin.com/api/api_post.php", bytes.NewReader(body.Bytes()))
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://pastebin.com/api/api_post.php", bytes.NewReader(body.Bytes()))
req.Header.Add("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/paymoapp/paymoapp.go b/pkg/detectors/paymoapp/paymoapp.go
index 79f67a7ea..904f71150 100644
--- a/pkg/detectors/paymoapp/paymoapp.go
+++ b/pkg/detectors/paymoapp/paymoapp.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.paymoapp.com/api/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.paymoapp.com/api/me", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/paymongo/paymongo.go b/pkg/detectors/paymongo/paymongo.go
index c6cc92ed6..14996df53 100644
--- a/pkg/detectors/paymongo/paymongo.go
+++ b/pkg/detectors/paymongo/paymongo.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"data":{"attributes":{"type":"paymaya"}}}`)
- req, _ := http.NewRequest("POST", "https://api.paymongo.com/v1/payment_methods", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.paymongo.com/v1/payment_methods", payload)
req.Header.Add("Content-Type", "application/json")
req.SetBasicAuth(resMatch, "")
res, err := client.Do(req)
diff --git a/pkg/detectors/paypaloauth/paypaloauth.go b/pkg/detectors/paypaloauth/paypaloauth.go
index 798721dd4..2da65ec51 100644
--- a/pkg/detectors/paypaloauth/paypaloauth.go
+++ b/pkg/detectors/paypaloauth/paypaloauth.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:%s", residMatch, resMatch)
encoded := b64.StdEncoding.EncodeToString([]byte(data))
payload := strings.NewReader("grant_type=client_credentials")
- req, _ := http.NewRequest("POST", "https://api-m.sandbox.paypal.com/v1/oauth2/token", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api-m.sandbox.paypal.com/v1/oauth2/token", payload)
req.Header.Add("Accept", "application/json")
req.Header.Add("Accept-Language", "en_US")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
diff --git a/pkg/detectors/paystack/paystack.go b/pkg/detectors/paystack/paystack.go
index d5bee2239..2c237fdd4 100644
--- a/pkg/detectors/paystack/paystack.go
+++ b/pkg/detectors/paystack/paystack.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.paystack.co/customer", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.paystack.co/customer", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/pdflayer/pdflayer.go b/pkg/detectors/pdflayer/pdflayer.go
index 497bc399a..d38d8a30e 100644
--- a/pkg/detectors/pdflayer/pdflayer.go
+++ b/pkg/detectors/pdflayer/pdflayer.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.pdflayer.com/api/convert?access_key=%s&document_url=https://pdflayer.com/downloads/invoice.html", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.pdflayer.com/api/convert?access_key=%s&document_url=https://pdflayer.com/downloads/invoice.html", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/pdfshift/pdfshift.go b/pkg/detectors/pdfshift/pdfshift.go
index 306355900..328d1401d 100644
--- a/pkg/detectors/pdfshift/pdfshift.go
+++ b/pkg/detectors/pdfshift/pdfshift.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.pdfshift.io/v3/credits/usage", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.pdfshift.io/v3/credits/usage", nil)
req.Header.Add("Content-Type", "application/json")
req.SetBasicAuth("api", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/peopledatalabs/peopledatalabs.go b/pkg/detectors/peopledatalabs/peopledatalabs.go
index b9a8f88e5..9c088fc41 100644
--- a/pkg/detectors/peopledatalabs/peopledatalabs.go
+++ b/pkg/detectors/peopledatalabs/peopledatalabs.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.peopledatalabs.com/v5/person/enrich?min_likelihood=6&profile=http://linkedin.com/in/williamhgates", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.peopledatalabs.com/v5/person/enrich?min_likelihood=6&profile=http://linkedin.com/in/williamhgates", nil)
req.Header.Add("X-Api-Key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/pepipost/pepipost.go b/pkg/detectors/pepipost/pepipost.go
index 9d044ecd6..a7d341478 100644
--- a/pkg/detectors/pepipost/pepipost.go
+++ b/pkg/detectors/pepipost/pepipost.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.pepipost.com/v5.1/domain/getDomains?domain=pepisandbox.com", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.pepipost.com/v5.1/domain/getDomains?domain=pepisandbox.com", nil)
req.Header.Add("api_key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/pipedrive/pipedrive.go b/pkg/detectors/pipedrive/pipedrive.go
index 33407d35d..6d481b126 100644
--- a/pkg/detectors/pipedrive/pipedrive.go
+++ b/pkg/detectors/pipedrive/pipedrive.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://hooman.pipedrive.com/api/v1/users?api_token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://hooman.pipedrive.com/api/v1/users?api_token="+resMatch, nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/pixabay/pixabay.go b/pkg/detectors/pixabay/pixabay.go
index c09fd48dd..5d0ee4bdc 100644
--- a/pkg/detectors/pixabay/pixabay.go
+++ b/pkg/detectors/pixabay/pixabay.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://pixabay.com/api/?key=%s&q=yellow+flowers&image_type=photo", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://pixabay.com/api/?key=%s&q=yellow+flowers&image_type=photo", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/plaidkey/plaidkey.go b/pkg/detectors/plaidkey/plaidkey.go
index 6c6720acc..60a39dccd 100644
--- a/pkg/detectors/plaidkey/plaidkey.go
+++ b/pkg/detectors/plaidkey/plaidkey.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"client_id":"` + idresMatch + `","secret":"` + resMatch + `","user":{"client_user_id":"60e3ee4019a2660010f8bc54","phone_number_verified_time":"0001-01-01T00:00:00Z","email_address_verified_time":"0001-01-01T00:00:00Z"},"client_name":"Plaid Test App","products":["auth","transactions"],"country_codes":["US"],"webhook":"https://webhook-uri.com","account_filters":{"depository":{"account_subtypes":["checking","savings"]}},"language":"en","link_customization_name":"default"}`)
- req, _ := http.NewRequest("POST", "https://development.plaid.com/link/token/create", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://development.plaid.com/link/token/create", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/planyo/planyo.go b/pkg/detectors/planyo/planyo.go
index 5c1745c06..e2d9fc08b 100644
--- a/pkg/detectors/planyo/planyo.go
+++ b/pkg/detectors/planyo/planyo.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://www.planyo.com/rest/?method=get_site_info&api_key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://www.planyo.com/rest/?method=get_site_info&api_key=%s", resMatch), nil)
req.Header.Add("Accept", "application/vnd.planyo+json; version=3")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/plivo/plivo.go b/pkg/detectors/plivo/plivo.go
index 1aab436ee..1b6fd4d68 100644
--- a/pkg/detectors/plivo/plivo.go
+++ b/pkg/detectors/plivo/plivo.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
stringResMatch := fmt.Sprintf("%s:%s", id, resMatch)
decodeSecret := b64.StdEncoding.EncodeToString([]byte(stringResMatch))
if verify {
- req, _ := http.NewRequest("GET", "https://api.plivo.com/v1/Account/"+id+"/Number/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.plivo.com/v1/Account/"+id+"/Number/", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", decodeSecret))
res, err := client.Do(req)
diff --git a/pkg/detectors/poloniex/poloniex.go b/pkg/detectors/poloniex/poloniex.go
index 845755e1a..f82f74513 100644
--- a/pkg/detectors/poloniex/poloniex.go
+++ b/pkg/detectors/poloniex/poloniex.go
@@ -73,7 +73,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
signature := getPoloniexSignature(resSecretMatch, payload.Encode())
- req, _ := http.NewRequest("POST", "https://poloniex.com/tradingApi", strings.NewReader(payload.Encode()))
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://poloniex.com/tradingApi", strings.NewReader(payload.Encode()))
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("Key", resMatch)
req.Header.Add("Sign", signature)
diff --git a/pkg/detectors/polygon/polygon.go b/pkg/detectors/polygon/polygon.go
index 63c251806..98941efff 100644
--- a/pkg/detectors/polygon/polygon.go
+++ b/pkg/detectors/polygon/polygon.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.polygon.io/v2/reference/locales?apiKey="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.polygon.io/v2/reference/locales?apiKey="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/positionstack/positionstack.go b/pkg/detectors/positionstack/positionstack.go
index 3e9b8f616..cdf746bfc 100644
--- a/pkg/detectors/positionstack/positionstack.go
+++ b/pkg/detectors/positionstack/positionstack.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.positionstack.com/v1/forward?access_key=%s&query=Philippines", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.positionstack.com/v1/forward?access_key=%s&query=Philippines", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/postageapp/postageapp.go b/pkg/detectors/postageapp/postageapp.go
index f55abce18..0c119fad2 100644
--- a/pkg/detectors/postageapp/postageapp.go
+++ b/pkg/detectors/postageapp/postageapp.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("POST", "https://api.postageapp.com/v.1.0/get_account_info.json?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.postageapp.com/v.1.0/get_account_info.json?api_key="+resMatch, nil)
req.Header.Add("Content-Transfer-Encoding", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/posthog/posthog.go b/pkg/detectors/posthog/posthog.go
index ca00e348f..9d195672e 100644
--- a/pkg/detectors/posthog/posthog.go
+++ b/pkg/detectors/posthog/posthog.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
"api_key": "` + resMatch + `",
"distinct_id": "1234"
}`)
- req, _ := http.NewRequest("POST", "https://app.posthog.com/decide/", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://app.posthog.com/decide/", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/postman/postman.go b/pkg/detectors/postman/postman.go
index d322065e8..c16be610b 100644
--- a/pkg/detectors/postman/postman.go
+++ b/pkg/detectors/postman/postman.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.getpostman.com/collections", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.getpostman.com/collections", nil)
req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/postmark/postmark.go b/pkg/detectors/postmark/postmark.go
index 63f66c86e..2baf8f662 100644
--- a/pkg/detectors/postmark/postmark.go
+++ b/pkg/detectors/postmark/postmark.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.postmarkapp.com/deliverystats", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.postmarkapp.com/deliverystats", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-Postmark-Server-Token", fmt.Sprintf("%s", resMatch))
diff --git a/pkg/detectors/powrbot/powrbot.go b/pkg/detectors/powrbot/powrbot.go
index dd8f47f8f..d87f79255 100644
--- a/pkg/detectors/powrbot/powrbot.go
+++ b/pkg/detectors/powrbot/powrbot.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://powrbot.com/api/v1/search/single/?company=Apple", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://powrbot.com/api/v1/search/single/?company=Apple", nil)
req.Header.Add("Authorization", fmt.Sprintf("secret-key %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/prospectcrm/prospectcrm.go b/pkg/detectors/prospectcrm/prospectcrm.go
index f7e5cf2c2..ba3d42b24 100644
--- a/pkg/detectors/prospectcrm/prospectcrm.go
+++ b/pkg/detectors/prospectcrm/prospectcrm.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api-batch-v1.prospect365.com/Contacts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api-batch-v1.prospect365.com/Contacts", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/prospectio/prospectio.go b/pkg/detectors/prospectio/prospectio.go
index 2eecdaad5..1b4cb7a1d 100644
--- a/pkg/detectors/prospectio/prospectio.go
+++ b/pkg/detectors/prospectio/prospectio.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.prospect.io/public/v1/prospects", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.prospect.io/public/v1/prospects", nil)
req.Header.Add("Authorization", fmt.Sprintf("%s", resMatch))
req.Header.Add("Content-Type", "application/vnd.api+json; charset=utf-8")
res, err := client.Do(req)
diff --git a/pkg/detectors/protocolsio/protocolsio.go b/pkg/detectors/protocolsio/protocolsio.go
index e5315f7b2..622385d0d 100644
--- a/pkg/detectors/protocolsio/protocolsio.go
+++ b/pkg/detectors/protocolsio/protocolsio.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.protocols.io/api/v3/session/profile", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.protocols.io/api/v3/session/profile", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/proxycrawl/proxycrawl.go b/pkg/detectors/proxycrawl/proxycrawl.go
index 8a17ba200..e208e3aa1 100644
--- a/pkg/detectors/proxycrawl/proxycrawl.go
+++ b/pkg/detectors/proxycrawl/proxycrawl.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.proxycrawl.com/leads?token=%s&domain=slack.com", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.proxycrawl.com/leads?token=%s&domain=slack.com", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/pubnubpublishkey/pubnubpublishkey.go b/pkg/detectors/pubnubpublishkey/pubnubpublishkey.go
index 0b708fec8..9814ba8a3 100644
--- a/pkg/detectors/pubnubpublishkey/pubnubpublishkey.go
+++ b/pkg/detectors/pubnubpublishkey/pubnubpublishkey.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
- req, _ := http.NewRequest("GET", "https://ps.pndsn.com/signal/"+resMatch+"/"+ressubMatch+"/0/ch1/0/%22typing_on%22?uuid=user-123", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://ps.pndsn.com/signal/"+resMatch+"/"+ressubMatch+"/0/ch1/0/%22typing_on%22?uuid=user-123", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/pubnubsubscriptionkey/pubnubsubscriptionkey.go b/pkg/detectors/pubnubsubscriptionkey/pubnubsubscriptionkey.go
index 3b07482df..b4945d763 100644
--- a/pkg/detectors/pubnubsubscriptionkey/pubnubsubscriptionkey.go
+++ b/pkg/detectors/pubnubsubscriptionkey/pubnubsubscriptionkey.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://ps.pndsn.com/v2/objects/"+resMatch+"/uuids", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://ps.pndsn.com/v2/objects/"+resMatch+"/uuids", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/purestake/purestake.go b/pkg/detectors/purestake/purestake.go
index ea9e21caf..d9a63daee 100644
--- a/pkg/detectors/purestake/purestake.go
+++ b/pkg/detectors/purestake/purestake.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://testnet-algorand.api.purestake.io/idx2/health", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://testnet-algorand.api.purestake.io/idx2/health", nil)
req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/pushbulletapikey/pushbulletapikey.go b/pkg/detectors/pushbulletapikey/pushbulletapikey.go
index 382a656a0..da6c84354 100644
--- a/pkg/detectors/pushbulletapikey/pushbulletapikey.go
+++ b/pkg/detectors/pushbulletapikey/pushbulletapikey.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.pushbullet.com/v2/users/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.pushbullet.com/v2/users/me", nil)
req.Header.Add("Access-Token", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/pusherchannelkey/pusherchannelkey.go b/pkg/detectors/pusherchannelkey/pusherchannelkey.go
index 6ca1110d7..47db7da6e 100644
--- a/pkg/detectors/pusherchannelkey/pusherchannelkey.go
+++ b/pkg/detectors/pusherchannelkey/pusherchannelkey.go
@@ -103,7 +103,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
url := "http://api-ap1.pusher.com/apps/" + resappMatch + "/events?auth_key=" + reskeyMatch + "&auth_signature=" + signature + "&auth_timestamp=" + timestamp + "&auth_version=1.0&body_md5=" + md5
- req, _ := http.NewRequest(method, url, payload)
+ req, _ := http.NewRequestWithContext(ctx, method, url, payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/qualaroo/qualaroo.go b/pkg/detectors/qualaroo/qualaroo.go
index 0909bd870..acb37f1c9 100644
--- a/pkg/detectors/qualaroo/qualaroo.go
+++ b/pkg/detectors/qualaroo/qualaroo.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.qualaroo.com/api/v1/nudges", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.qualaroo.com/api/v1/nudges", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/qubole/qubole.go b/pkg/detectors/qubole/qubole.go
index 4533eba05..66cd1aa7d 100644
--- a/pkg/detectors/qubole/qubole.go
+++ b/pkg/detectors/qubole/qubole.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://us.qubole.com/api/v1.2/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://us.qubole.com/api/v1.2/account", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("X-AUTH-TOKEN", fmt.Sprintf("%s", resMatch))
diff --git a/pkg/detectors/quickmetrics/quickmetrics.go b/pkg/detectors/quickmetrics/quickmetrics.go
index d777c7fa3..668e6c581 100644
--- a/pkg/detectors/quickmetrics/quickmetrics.go
+++ b/pkg/detectors/quickmetrics/quickmetrics.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`[{"name":"api.response.time","dimension":null,"values":[[1568319841,12.4],[1568319856,9.3],[1568319860,234],[1568319863,3.2]]},{"name":"click.color","dimension":"green","values":[[1568319841,1],[1568319856,1],[1568319860,1],[1568319863,1]]}]`)
- req, _ := http.NewRequest("POST", "https://qckm.io/list", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://qckm.io/list", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-qm-key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/rapidapi/rapidapi.go b/pkg/detectors/rapidapi/rapidapi.go
index 9c18349e4..9c44c32a4 100644
--- a/pkg/detectors/rapidapi/rapidapi.go
+++ b/pkg/detectors/rapidapi/rapidapi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://covid-19-tracking.p.rapidapi.com/v1", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://covid-19-tracking.p.rapidapi.com/v1", nil)
req.Header.Add("x-rapidapi-key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/raven/raven.go b/pkg/detectors/raven/raven.go
index 64e8bed02..e24ecc2e6 100644
--- a/pkg/detectors/raven/raven.go
+++ b/pkg/detectors/raven/raven.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.raventools.com/api?key=%s&method=profile_info&format=json", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.raventools.com/api?key=%s&method=profile_info&format=json", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/rawg/rawg.go b/pkg/detectors/rawg/rawg.go
index 2bf806d98..b1f0b6942 100644
--- a/pkg/detectors/rawg/rawg.go
+++ b/pkg/detectors/rawg/rawg.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.rawg.io/api/platforms?key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.rawg.io/api/platforms?key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/readme/readme.go b/pkg/detectors/readme/readme.go
index ee76d4869..e2b783940 100644
--- a/pkg/detectors/readme/readme.go
+++ b/pkg/detectors/readme/readme.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://dash.readme.com/api/v1", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://dash.readme.com/api/v1", nil)
req.SetBasicAuth(resMatch, "")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/reallysimplesystems/reallysimplesystems.go b/pkg/detectors/reallysimplesystems/reallysimplesystems.go
index ad177432b..d36bab26b 100644
--- a/pkg/detectors/reallysimplesystems/reallysimplesystems.go
+++ b/pkg/detectors/reallysimplesystems/reallysimplesystems.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://apiv4.reallysimplesystems.com/accounts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://apiv4.reallysimplesystems.com/accounts", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/rebrandly/rebrandly.go b/pkg/detectors/rebrandly/rebrandly.go
index 35bf3d16b..eee9581bc 100644
--- a/pkg/detectors/rebrandly/rebrandly.go
+++ b/pkg/detectors/rebrandly/rebrandly.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.rebrandly.com/v1/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.rebrandly.com/v1/account", nil)
req.Header.Add("apikey", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/refiner/refiner.go b/pkg/detectors/refiner/refiner.go
index a91fd0f0d..f2a2cabc6 100644
--- a/pkg/detectors/refiner/refiner.go
+++ b/pkg/detectors/refiner/refiner.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader("id=Your-User-Id&event=Your%20event%20name")
- req, _ := http.NewRequest("POST", "https://api.refiner.io/v1/identify-user", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.refiner.io/v1/identify-user", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/restpack/restpack.go b/pkg/detectors/restpack/restpack.go
index d93db2c63..c9b4a27f3 100644
--- a/pkg/detectors/restpack/restpack.go
+++ b/pkg/detectors/restpack/restpack.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://restpack.io/api/screenshot/usage?access_token=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://restpack.io/api/screenshot/usage?access_token=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/restpackhtmltopdfapi/restpackhtmltopdfapi.go b/pkg/detectors/restpackhtmltopdfapi/restpackhtmltopdfapi.go
index b531acfd8..db46432db 100644
--- a/pkg/detectors/restpackhtmltopdfapi/restpackhtmltopdfapi.go
+++ b/pkg/detectors/restpackhtmltopdfapi/restpackhtmltopdfapi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://restpack.io/api/html2pdf/usage", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://restpack.io/api/html2pdf/usage", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-Access-Token", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/restpackscreenshotapi/restpackscreenshotapi.go b/pkg/detectors/restpackscreenshotapi/restpackscreenshotapi.go
index 429f2e72f..e5baf87d7 100644
--- a/pkg/detectors/restpackscreenshotapi/restpackscreenshotapi.go
+++ b/pkg/detectors/restpackscreenshotapi/restpackscreenshotapi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://restpack.io/api/screenshot/usage", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://restpack.io/api/screenshot/usage", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-Access-Token", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/rev/rev.go b/pkg/detectors/rev/rev.go
index b76b1f337..6b7c15c53 100644
--- a/pkg/detectors/rev/rev.go
+++ b/pkg/detectors/rev/rev.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.rev.com/api/v1/orders", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.rev.com/api/v1/orders", nil)
req.Header.Add("Authorization", fmt.Sprintf("Rev %s:%s", resClientMatch, resUserMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/revampcrm/revampcrm.go b/pkg/detectors/revampcrm/revampcrm.go
index 1c3398d21..1f397c87d 100644
--- a/pkg/detectors/revampcrm/revampcrm.go
+++ b/pkg/detectors/revampcrm/revampcrm.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(tokenPatMatch),
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.revampcrm.com/api/1.0/User/WhoAmI", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.revampcrm.com/api/1.0/User/WhoAmI", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/ringcentral/ringcentral.go b/pkg/detectors/ringcentral/ringcentral.go
index 9174cb6b4..af3061aab 100644
--- a/pkg/detectors/ringcentral/ringcentral.go
+++ b/pkg/detectors/ringcentral/ringcentral.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://platform.devtest.ringcentral.com/restapi/oauth/authorize?response_type=code&redirect_uri=%s&client_id=%s", resURI, resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://platform.devtest.ringcentral.com/restapi/oauth/authorize?response_type=code&redirect_uri=%s&client_id=%s", resURI, resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/ritekit/ritekit.go b/pkg/detectors/ritekit/ritekit.go
index 9141bc6ef..0e268a629 100644
--- a/pkg/detectors/ritekit/ritekit.go
+++ b/pkg/detectors/ritekit/ritekit.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.ritekit.com/v1/stats/multiple-hashtags?tags=hello&client_id=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.ritekit.com/v1/stats/multiple-hashtags?tags=hello&client_id=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/roaring/roaring.go b/pkg/detectors/roaring/roaring.go
index 0767d0ee9..674b8196d 100644
--- a/pkg/detectors/roaring/roaring.go
+++ b/pkg/detectors/roaring/roaring.go
@@ -63,7 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:%s", resClient, resSecret)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
payload := strings.NewReader("grant_type=client_credentials")
- req, _ := http.NewRequest("POST", "https://api.roaring.io/token", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.roaring.io/token", payload)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/rocketreach/rocketreach.go b/pkg/detectors/rocketreach/rocketreach.go
index fe3e0dd12..b2dd8099f 100644
--- a/pkg/detectors/rocketreach/rocketreach.go
+++ b/pkg/detectors/rocketreach/rocketreach.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.rocketreach.co/v2/api/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.rocketreach.co/v2/api/account", nil)
req.Header.Add("Api-Key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/roninapp/roninapp.go b/pkg/detectors/roninapp/roninapp.go
index 268f77e29..092ae8e0c 100644
--- a/pkg/detectors/roninapp/roninapp.go
+++ b/pkg/detectors/roninapp/roninapp.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://"+resIdMatch+".roninapp.com/api/v2/invoices", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://"+resIdMatch+".roninapp.com/api/v2/invoices", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/route4me/route4me.go b/pkg/detectors/route4me/route4me.go
index 5952f7a26..a7609f2a1 100644
--- a/pkg/detectors/route4me/route4me.go
+++ b/pkg/detectors/route4me/route4me.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.route4me.com/api.v4/address_book.php?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.route4me.com/api.v4/address_book.php?api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/rubygems/rubygems.go b/pkg/detectors/rubygems/rubygems.go
index 7e33d9e1f..162aba22c 100644
--- a/pkg/detectors/rubygems/rubygems.go
+++ b/pkg/detectors/rubygems/rubygems.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://rubygems.org/api/v1/gems", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://rubygems.org/api/v1/gems", nil)
req.Header.Add("Accept", "*/*")
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/runrunit/runrunit.go b/pkg/detectors/runrunit/runrunit.go
index d624b4175..5d336432a 100644
--- a/pkg/detectors/runrunit/runrunit.go
+++ b/pkg/detectors/runrunit/runrunit.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://runrun.it/api/v1.0/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://runrun.it/api/v1.0/users", nil)
req.Header.Add("App-Key", resMatch)
req.Header.Add("User-Token", resUserTokenMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/salesblink/salesblink.go b/pkg/detectors/salesblink/salesblink.go
index b8cb65d87..53dec2e21 100644
--- a/pkg/detectors/salesblink/salesblink.go
+++ b/pkg/detectors/salesblink/salesblink.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://run.salesblink.io/api/campaigns", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://run.salesblink.io/api/campaigns", nil)
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/salescookie/salescookie.go b/pkg/detectors/salescookie/salescookie.go
index 1ab75e277..a6faba425 100644
--- a/pkg/detectors/salescookie/salescookie.go
+++ b/pkg/detectors/salescookie/salescookie.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"date":"2021-07-04T02:47:42.1442597Z","uniqueId":"id-123","revenue":1.3,"profit":-2.5,"currency":"USD","transactionStatus":"closed won","customer":"Candy By Mail","product":"Lemon Cake","owner1":"John Doe","owner2":"Jane Doe","owner3":"Bob Smith","team1":"USA","team2":"Washington","team3":"98004","quantity":3,"costPerUnit":3.14,"taxes":6.54,"otherText1":"additional data","otherText2":"more data","otherText3":"even more data","otherNumeric1":123.45,"otherNumeric2":54.321,"otherNumeric3":-98.76,"otherDate1":"2019-01-03T06:03:01Z","otherDate2":"2019-05-10T08:05:09Z","otherDate3":"2019-09-04T12:17:33Z"}`)
- req, _ := http.NewRequest("POST", "https://salescookie.com/app/Api/CreateTransaction", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://salescookie.com/app/Api/CreateTransaction", payload)
req.Header.Add("X-ApiKey", resMatch)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
diff --git a/pkg/detectors/salesflare/salesflare.go b/pkg/detectors/salesflare/salesflare.go
index c152d51c0..71dcf58d9 100644
--- a/pkg/detectors/salesflare/salesflare.go
+++ b/pkg/detectors/salesflare/salesflare.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.salesflare.com/me/contacts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.salesflare.com/me/contacts", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/satismeterprojectkey/satismeterprojectkey.go b/pkg/detectors/satismeterprojectkey/satismeterprojectkey.go
index 7b36a83ab..afde83b43 100644
--- a/pkg/detectors/satismeterprojectkey/satismeterprojectkey.go
+++ b/pkg/detectors/satismeterprojectkey/satismeterprojectkey.go
@@ -72,7 +72,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:%s", resEmailMatch, resPassMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://app.satismeter.com/api/users?project="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.satismeter.com/api/users?project="+resMatch, nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/satismeterwritekey/satismeterwritekey.go b/pkg/detectors/satismeterwritekey/satismeterwritekey.go
index e4448acf6..1b75ccb78 100644
--- a/pkg/detectors/satismeterwritekey/satismeterwritekey.go
+++ b/pkg/detectors/satismeterwritekey/satismeterwritekey.go
@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
"event": "This is the event name",
"writeKey": "` + resMatch + `"
}`)
- req, _ := http.NewRequest("POST", "https://app.satismeter.com/api/users?type=track", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://app.satismeter.com/api/users?type=track", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/saucelabs/saucelabs.go b/pkg/detectors/saucelabs/saucelabs.go
index 367facf39..ca4cfd9f8 100644
--- a/pkg/detectors/saucelabs/saucelabs.go
+++ b/pkg/detectors/saucelabs/saucelabs.go
@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", idMatch, keyMatch)
encoded := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.eu-central-1.saucelabs.com/team-management/v1/teams", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.eu-central-1.saucelabs.com/team-management/v1/teams", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", encoded))
//req.SetBasicAuth(idMatch, keyMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/scalewaykey/scalewaykey.go b/pkg/detectors/scalewaykey/scalewaykey.go
index d00938502..b6b28d658 100644
--- a/pkg/detectors/scalewaykey/scalewaykey.go
+++ b/pkg/detectors/scalewaykey/scalewaykey.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.scaleway.com/instance/v1/zones/fr-par-1/servers", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.scaleway.com/instance/v1/zones/fr-par-1/servers", nil)
req.Header.Add("X-Auth-Token", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/scrapeowl/scrapeowl.go b/pkg/detectors/scrapeowl/scrapeowl.go
index 71c867261..173805a57 100644
--- a/pkg/detectors/scrapeowl/scrapeowl.go
+++ b/pkg/detectors/scrapeowl/scrapeowl.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.scrapeowl.com/v1/scrape?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.scrapeowl.com/v1/scrape?api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/scraperapi/scraperapi.go b/pkg/detectors/scraperapi/scraperapi.go
index a0dcebd8d..5bf39c2c7 100644
--- a/pkg/detectors/scraperapi/scraperapi.go
+++ b/pkg/detectors/scraperapi/scraperapi.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 15 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.scraperapi.com?api_key=%s&url=google.com", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.scraperapi.com?api_key=%s&url=google.com", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/scraperbox/scraperbox.go b/pkg/detectors/scraperbox/scraperbox.go
index 26db0b485..4bce063ca 100644
--- a/pkg/detectors/scraperbox/scraperbox.go
+++ b/pkg/detectors/scraperbox/scraperbox.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.scraperbox.com/scrape?token=%s&url=https://google.com", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.scraperbox.com/scrape?token=%s&url=https://google.com", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/scrapersite/scrapersite.go b/pkg/detectors/scrapersite/scrapersite.go
index 190dc4ad0..bd9d22c5a 100644
--- a/pkg/detectors/scrapersite/scrapersite.go
+++ b/pkg/detectors/scrapersite/scrapersite.go
@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://scrapersite.com/api-v1?api_key=%s&url=https://google.com", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://scrapersite.com/api-v1?api_key=%s&url=https://google.com", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/scrapestack/scrapestack.go b/pkg/detectors/scrapestack/scrapestack.go
index aca954566..df69f461c 100644
--- a/pkg/detectors/scrapestack/scrapestack.go
+++ b/pkg/detectors/scrapestack/scrapestack.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.scrapestack.com/scrape?access_key=%s&url=https://apple.com", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.scrapestack.com/scrape?access_key=%s&url=https://apple.com", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/scrapfly/scrapfly.go b/pkg/detectors/scrapfly/scrapfly.go
index fd5e9ee4a..fdc22378c 100644
--- a/pkg/detectors/scrapfly/scrapfly.go
+++ b/pkg/detectors/scrapfly/scrapfly.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.scrapfly.io/scrape?key=%s&url=https://google.com", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.scrapfly.io/scrape?key=%s&url=https://google.com", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/scrapingant/scrapingant.go b/pkg/detectors/scrapingant/scrapingant.go
index 89f47d94e..ac01a77b1 100644
--- a/pkg/detectors/scrapingant/scrapingant.go
+++ b/pkg/detectors/scrapingant/scrapingant.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", "https://api.scrapingant.com/v1/general?url=google.com", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.scrapingant.com/v1/general?url=google.com", nil)
req.Header.Add("x-api-key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/scrapingbee/scrapingbee.go b/pkg/detectors/scrapingbee/scrapingbee.go
index 3325e065a..50ea6e3a8 100644
--- a/pkg/detectors/scrapingbee/scrapingbee.go
+++ b/pkg/detectors/scrapingbee/scrapingbee.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.scrapingbee.com/api/v1/?api_key="+resMatch+"&url=http://httpbin.org/anything?json&render_js=false", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.scrapingbee.com/api/v1/?api_key="+resMatch+"&url=http://httpbin.org/anything?json&render_js=false", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/screenshotapi/screenshotapi.go b/pkg/detectors/screenshotapi/screenshotapi.go
index 338538640..f5227c81b 100644
--- a/pkg/detectors/screenshotapi/screenshotapi.go
+++ b/pkg/detectors/screenshotapi/screenshotapi.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", "https://shot.screenshotapi.net/screenshot?token="+resMatch+"&url=https://google.com&width=1920&height=1080&output=image", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://shot.screenshotapi.net/screenshot?token="+resMatch+"&url=https://google.com&width=1920&height=1080&output=image", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/screenshotlayer/screenshotlayer.go b/pkg/detectors/screenshotlayer/screenshotlayer.go
index 062709057..014c369ad 100644
--- a/pkg/detectors/screenshotlayer/screenshotlayer.go
+++ b/pkg/detectors/screenshotlayer/screenshotlayer.go
@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.screenshotlayer.com/api/capture?access_key=%s&url=https://google.com", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.screenshotlayer.com/api/capture?access_key=%s&url=https://google.com", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/securitytrails/securitytrails.go b/pkg/detectors/securitytrails/securitytrails.go
index a55c54e28..e0bfbf838 100644
--- a/pkg/detectors/securitytrails/securitytrails.go
+++ b/pkg/detectors/securitytrails/securitytrails.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.securitytrails.com/v1/ping", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.securitytrails.com/v1/ping", nil)
req.Header.Add("APIKEY", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/segmentapikey/segmentapikey.go b/pkg/detectors/segmentapikey/segmentapikey.go
index 14179d77b..466ea0915 100644
--- a/pkg/detectors/segmentapikey/segmentapikey.go
+++ b/pkg/detectors/segmentapikey/segmentapikey.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://platform.segmentapis.com/v1beta/workspaces", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://platform.segmentapis.com/v1beta/workspaces", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/selectpdf/selectpdf.go b/pkg/detectors/selectpdf/selectpdf.go
index 5ed9a3cf4..c2360ecfd 100644
--- a/pkg/detectors/selectpdf/selectpdf.go
+++ b/pkg/detectors/selectpdf/selectpdf.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://selectpdf.com/api2/convert/?key=%s&url=google.com", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://selectpdf.com/api2/convert/?key=%s&url=google.com", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/semaphore/semaphore.go b/pkg/detectors/semaphore/semaphore.go
index ee676f9e6..b4cb826a7 100644
--- a/pkg/detectors/semaphore/semaphore.go
+++ b/pkg/detectors/semaphore/semaphore.go
@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.semaphore.co/api/v4/account?apikey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.semaphore.co/api/v4/account?apikey=%s", resMatch), nil)
req.Header.Add("Accept", "application/vnd.semaphore+json; version=3")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/sendgrid/sendgrid.go b/pkg/detectors/sendgrid/sendgrid.go
index 486afa887..82f8f3a30 100644
--- a/pkg/detectors/sendgrid/sendgrid.go
+++ b/pkg/detectors/sendgrid/sendgrid.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
baseURL := "https://api.sendgrid.com/v3/templates"
// test `read_user` scope
- req, _ := http.NewRequest("GET", baseURL, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", baseURL, nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", res))
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
diff --git a/pkg/detectors/sendinbluev2/sendinbluev2.go b/pkg/detectors/sendinbluev2/sendinbluev2.go
index 5582d874d..0bfc6e9ac 100644
--- a/pkg/detectors/sendinbluev2/sendinbluev2.go
+++ b/pkg/detectors/sendinbluev2/sendinbluev2.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.sendinblue.com/v3/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.sendinblue.com/v3/account", nil)
req.Header.Add("api-key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/sentiment/sentiment.go b/pkg/detectors/sentiment/sentiment.go
index db7e50f6b..c8e93b93d 100644
--- a/pkg/detectors/sentiment/sentiment.go
+++ b/pkg/detectors/sentiment/sentiment.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.sentimentinvestor.com/v4/parsed?symbol=AAPL&token="+tokenMatch+"&key="+keyMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.sentimentinvestor.com/v4/parsed?symbol=AAPL&token="+tokenMatch+"&key="+keyMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/sentrytoken/sentrytoken.go b/pkg/detectors/sentrytoken/sentrytoken.go
index af7cf6e65..f8fcabab9 100644
--- a/pkg/detectors/sentrytoken/sentrytoken.go
+++ b/pkg/detectors/sentrytoken/sentrytoken.go
@@ -49,7 +49,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, err := http.NewRequest("GET", "https://sentry.io/api/0/projects/", nil)
+ req, err := http.NewRequestWithContext(ctx, "GET", "https://sentry.io/api/0/projects/", nil)
if err != nil {
continue
}
diff --git a/pkg/detectors/serphouse/serphouse.go b/pkg/detectors/serphouse/serphouse.go
index 9e18e595c..70c0599d4 100644
--- a/pkg/detectors/serphouse/serphouse.go
+++ b/pkg/detectors/serphouse/serphouse.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.serphouse.com/account/info", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.serphouse.com/account/info", nil)
req.Header.Add("Accept", "application/vnd.serphouse+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/serpstack/serpstack.go b/pkg/detectors/serpstack/serpstack.go
index e9cc5970e..7eab726f9 100644
--- a/pkg/detectors/serpstack/serpstack.go
+++ b/pkg/detectors/serpstack/serpstack.go
@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.serpstack.com/search?access_key=%s&query=Mcdonalds", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.serpstack.com/search?access_key=%s&query=Mcdonalds", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/sheety/sheety.go b/pkg/detectors/sheety/sheety.go
index aa0001c5b..94818822f 100644
--- a/pkg/detectors/sheety/sheety.go
+++ b/pkg/detectors/sheety/sheety.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.sheety.co/"+resIdMatch+"/restaurantMenu/menuItems", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.sheety.co/"+resIdMatch+"/restaurantMenu/menuItems", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/sherpadesk/sherpadesk.go b/pkg/detectors/sherpadesk/sherpadesk.go
index c6e0c2bac..7ad2b864c 100644
--- a/pkg/detectors/sherpadesk/sherpadesk.go
+++ b/pkg/detectors/sherpadesk/sherpadesk.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("x:%s", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.sherpadesk.com/organizations/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.sherpadesk.com/organizations/", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/shipday/shipday.go b/pkg/detectors/shipday/shipday.go
index b49f0309e..fabbcfd01 100644
--- a/pkg/detectors/shipday/shipday.go
+++ b/pkg/detectors/shipday/shipday.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.shipday.com/carriers", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.shipday.com/carriers", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/shodankey/shodankey.go b/pkg/detectors/shodankey/shodankey.go
index 5baf1e559..43b97e85f 100644
--- a/pkg/detectors/shodankey/shodankey.go
+++ b/pkg/detectors/shodankey/shodankey.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.shodan.io/shodan/host/count?key="+resMatch+"&query=port:22&facets=org,os", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.shodan.io/shodan/host/count?key="+resMatch+"&query=port:22&facets=org,os", nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/shortcut/shortcut.go b/pkg/detectors/shortcut/shortcut.go
index 33bb82134..7613c0d20 100644
--- a/pkg/detectors/shortcut/shortcut.go
+++ b/pkg/detectors/shortcut/shortcut.go
@@ -51,13 +51,19 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.app.shortcut.com/api/v3/categories", nil)
+ req, err := http.NewRequestWithContext(ctx, "GET", "https://api.app.shortcut.com/api/v3/categories", nil)
+ if err != nil {
+ continue
+ }
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Shortcut-Token", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
- bodyBytes, _ := ioutil.ReadAll(res.Body)
+ bodyBytes, err := ioutil.ReadAll(res.Body)
+ if err != nil {
+ continue
+ }
body := string(bodyBytes)
if !strings.Contains(body, "Unauthorized") {
diff --git a/pkg/detectors/shotstack/shotstack.go b/pkg/detectors/shotstack/shotstack.go
index 39a290808..76d4255c9 100644
--- a/pkg/detectors/shotstack/shotstack.go
+++ b/pkg/detectors/shotstack/shotstack.go
@@ -80,7 +80,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
"output":{"format":"mp4", "resolution":"sd"
}
}`)
- req, _ := http.NewRequest("POST", "https://api.shotstack.io/stage/render", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.shotstack.io/stage/render", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("x-api-key", resMatch)
diff --git a/pkg/detectors/shutterstock/shutterstock.go b/pkg/detectors/shutterstock/shutterstock.go
index 3fdc1e91f..e3f017b20 100644
--- a/pkg/detectors/shutterstock/shutterstock.go
+++ b/pkg/detectors/shutterstock/shutterstock.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.shutterstock.com/v2/images/search", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.shutterstock.com/v2/images/search", nil)
req.Header.Add("Accept", "application/json")
req.SetBasicAuth(resMatch, resSecretMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/shutterstockoauth/shutterstockoauth.go b/pkg/detectors/shutterstockoauth/shutterstockoauth.go
index b3baf2e58..0b1a3ef99 100644
--- a/pkg/detectors/shutterstockoauth/shutterstockoauth.go
+++ b/pkg/detectors/shutterstockoauth/shutterstockoauth.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.shutterstock.com/v2/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.shutterstock.com/v2/user", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/signalwire/signalwire.go b/pkg/detectors/signalwire/signalwire.go
index 1d1662aef..33024627b 100644
--- a/pkg/detectors/signalwire/signalwire.go
+++ b/pkg/detectors/signalwire/signalwire.go
@@ -70,7 +70,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", resID, resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://%s/api/laml/2010-04-01/Accounts", resURL), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s/api/laml/2010-04-01/Accounts", resURL), nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/signaturit/signaturit.go b/pkg/detectors/signaturit/signaturit.go
index 1fe3531ee..c5cd0bf9c 100644
--- a/pkg/detectors/signaturit/signaturit.go
+++ b/pkg/detectors/signaturit/signaturit.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.sandbox.signaturit.com/v3/signatures.json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.sandbox.signaturit.com/v3/signatures.json", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/signupgenius/signupgenius.go b/pkg/detectors/signupgenius/signupgenius.go
index 7b1f44f97..075056c48 100644
--- a/pkg/detectors/signupgenius/signupgenius.go
+++ b/pkg/detectors/signupgenius/signupgenius.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.signupgenius.com/v2/k/user/profile/?user_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.signupgenius.com/v2/k/user/profile/?user_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/sigopt/sigopt.go b/pkg/detectors/sigopt/sigopt.go
index 76315fc83..63b5dadb0 100644
--- a/pkg/detectors/sigopt/sigopt.go
+++ b/pkg/detectors/sigopt/sigopt.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.sigopt.com/v1/experiments", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.sigopt.com/v1/experiments", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/simplesat/simplesat.go b/pkg/detectors/simplesat/simplesat.go
index 911926e06..ed58478b8 100644
--- a/pkg/detectors/simplesat/simplesat.go
+++ b/pkg/detectors/simplesat/simplesat.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.simplesat.io/api/answers/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.simplesat.io/api/answers/", nil)
req.Header.Add("X-Simplesat-Token", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/simplynoted/simplynoted.go b/pkg/detectors/simplynoted/simplynoted.go
index bd5c5b188..e819b1c17 100644
--- a/pkg/detectors/simplynoted/simplynoted.go
+++ b/pkg/detectors/simplynoted/simplynoted.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.simplynoted.com/api/products", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.simplynoted.com/api/products", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/simvoly/simvoly.go b/pkg/detectors/simvoly/simvoly.go
index 23ffbf4fb..1e0bb4321 100644
--- a/pkg/detectors/simvoly/simvoly.go
+++ b/pkg/detectors/simvoly/simvoly.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://rendyplayground.simvoly.com/api/site/members?group_id=12&limit=25&skip=25", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://rendyplayground.simvoly.com/api/site/members?group_id=12&limit=25&skip=25", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/sinchmessage/sinchmessage.go b/pkg/detectors/sinchmessage/sinchmessage.go
index df1707368..7bfd0d441 100644
--- a/pkg/detectors/sinchmessage/sinchmessage.go
+++ b/pkg/detectors/sinchmessage/sinchmessage.go
@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
"to": [ "639668957581" ],
"body": "This is a test message from your Sinch account"
}`)
- req, _ := http.NewRequest("POST", "https://sms.api.sinch.com/xms/v1/"+resIdMatch+"/batches", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://sms.api.sinch.com/xms/v1/"+resIdMatch+"/batches", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/siteleaf/siteleaf.go b/pkg/detectors/siteleaf/siteleaf.go
index 63494be0c..646228ac1 100644
--- a/pkg/detectors/siteleaf/siteleaf.go
+++ b/pkg/detectors/siteleaf/siteleaf.go
@@ -63,7 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:%s", resIdMatch, resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.siteleaf.com/v2/sites", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.siteleaf.com/v2/sites", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/skrappio/skrappio.go b/pkg/detectors/skrappio/skrappio.go
index 1f252f963..7ea0adc6e 100644
--- a/pkg/detectors/skrappio/skrappio.go
+++ b/pkg/detectors/skrappio/skrappio.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.skrapp.io/api/v2/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.skrapp.io/api/v2/account", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-Access-Key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/skybiometry/skybiometry.go b/pkg/detectors/skybiometry/skybiometry.go
index 5e99e2184..469270447 100644
--- a/pkg/detectors/skybiometry/skybiometry.go
+++ b/pkg/detectors/skybiometry/skybiometry.go
@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
payload.Add("api_key", resMatch)
payload.Add("api_secret", resSecretMatch)
- req, _ := http.NewRequest("GET", "http://api.skybiometry.com/fc/account/authenticate?"+payload.Encode(), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "http://api.skybiometry.com/fc/account/authenticate?"+payload.Encode(), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/slack/slack.go b/pkg/detectors/slack/slack.go
index 3565adb26..d48147aab 100644
--- a/pkg/detectors/slack/slack.go
+++ b/pkg/detectors/slack/slack.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
client := common.SaneHttpClient()
- req, _ := http.NewRequest("POST", verifyURL, nil)
+ req, _ := http.NewRequestWithContext(ctx, "POST", verifyURL, nil)
req.Header.Add("Content-Type", "application/json; charset=utf-8")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token))
res, err := client.Do(req)
diff --git a/pkg/detectors/slackwebhook/slackwebhook.go b/pkg/detectors/slackwebhook/slackwebhook.go
index eb9bd0cfd..3c5ffcb2d 100644
--- a/pkg/detectors/slackwebhook/slackwebhook.go
+++ b/pkg/detectors/slackwebhook/slackwebhook.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"text": ""}`)
- req, _ := http.NewRequest("POST", resMatch, payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", resMatch, payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/smartsheets/smartsheets.go b/pkg/detectors/smartsheets/smartsheets.go
index f3b2d258f..f1906552f 100644
--- a/pkg/detectors/smartsheets/smartsheets.go
+++ b/pkg/detectors/smartsheets/smartsheets.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.smartsheet.com/2.0/sheets", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.smartsheet.com/2.0/sheets", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/smartystreets/smartystreets.go b/pkg/detectors/smartystreets/smartystreets.go
index 3cc46487c..1806e5fe7 100644
--- a/pkg/detectors/smartystreets/smartystreets.go
+++ b/pkg/detectors/smartystreets/smartystreets.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://us-zipcode.api.smartystreets.com/lookup?auth-id=%s&auth-token=%s&state=CA&zipcode=94035", resIdMatch, resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://us-zipcode.api.smartystreets.com/lookup?auth-id=%s&auth-token=%s&state=CA&zipcode=94035", resIdMatch, resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/smooch/smooch.go b/pkg/detectors/smooch/smooch.go
index 502811232..55ed804fa 100644
--- a/pkg/detectors/smooch/smooch.go
+++ b/pkg/detectors/smooch/smooch.go
@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", resMatch, resSecret)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.smooch.io/v2/apps", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.smooch.io/v2/apps", nil)
req.Header.Add("Accept", "application/vnd.smooch+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/snipcart/snipcart.go b/pkg/detectors/snipcart/snipcart.go
index 599e081b1..8a11d8074 100644
--- a/pkg/detectors/snipcart/snipcart.go
+++ b/pkg/detectors/snipcart/snipcart.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://app.snipcart.com/api/orders", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.snipcart.com/api/orders", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/snykkey/snykkey.go b/pkg/detectors/snykkey/snykkey.go
index ae1a64d03..5c4ac98cd 100644
--- a/pkg/detectors/snykkey/snykkey.go
+++ b/pkg/detectors/snykkey/snykkey.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://snyk.io/api/v1/user/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://snyk.io/api/v1/user/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("token %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/sparkpost/sparkpost.go b/pkg/detectors/sparkpost/sparkpost.go
index 0f9849c99..ed127c401 100644
--- a/pkg/detectors/sparkpost/sparkpost.go
+++ b/pkg/detectors/sparkpost/sparkpost.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.sparkpost.com/api/v1/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.sparkpost.com/api/v1/account", nil)
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/splunkobservabilitytoken/splunkobservabilitytoken.go b/pkg/detectors/splunkobservabilitytoken/splunkobservabilitytoken.go
index 0b68551ab..a03f0dacd 100644
--- a/pkg/detectors/splunkobservabilitytoken/splunkobservabilitytoken.go
+++ b/pkg/detectors/splunkobservabilitytoken/splunkobservabilitytoken.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.us1.signalfx.com/v2/dashboard", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.us1.signalfx.com/v2/dashboard", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Sf-Token", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/spoonacular/spoonacular.go b/pkg/detectors/spoonacular/spoonacular.go
index 6ff32a610..97ee75b4e 100644
--- a/pkg/detectors/spoonacular/spoonacular.go
+++ b/pkg/detectors/spoonacular/spoonacular.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.spoonacular.com/recipes/random?apiKey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.spoonacular.com/recipes/random?apiKey=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/sportsmonk/sportsmonk.go b/pkg/detectors/sportsmonk/sportsmonk.go
index 87120f78e..01b55c8cd 100644
--- a/pkg/detectors/sportsmonk/sportsmonk.go
+++ b/pkg/detectors/sportsmonk/sportsmonk.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://soccer.sportmonks.com/api/v2.0/leagues?api_token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://soccer.sportmonks.com/api/v2.0/leagues?api_token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/squarespace/squarespace.go b/pkg/detectors/squarespace/squarespace.go
index 51e4f52f0..4bf371744 100644
--- a/pkg/detectors/squarespace/squarespace.go
+++ b/pkg/detectors/squarespace/squarespace.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.squarespace.com/1.0/profiles?sortField=email&sortDirection=asc&filter=isCustomer,true;hasAccount,true", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.squarespace.com/1.0/profiles?sortField=email&sortDirection=asc&filter=isCustomer,true;hasAccount,true", nil)
req.Header.Add("User-Agent", "YOUR_CUSTOM_APP_DESCRIPTION")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/squareup/squareup.go b/pkg/detectors/squareup/squareup.go
index 72731dca3..0cf7fd176 100644
--- a/pkg/detectors/squareup/squareup.go
+++ b/pkg/detectors/squareup/squareup.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://connect.squareup.com/oauth2/authorize?client_id=%s&scope=CUSTOMERS_WRITE+CUSTOMERS_READ&session=False&state=82201dd8d83d23cc8a48caf52b", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://connect.squareup.com/oauth2/authorize?client_id=%s&scope=CUSTOMERS_WRITE+CUSTOMERS_READ&session=False&state=82201dd8d83d23cc8a48caf52b", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/sslmate/sslmate.go b/pkg/detectors/sslmate/sslmate.go
index 90879d034..3fe6610e5 100644
--- a/pkg/detectors/sslmate/sslmate.go
+++ b/pkg/detectors/sslmate/sslmate.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://sslmate.com/api/v2/certs/example.com?expand=current.crt", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://sslmate.com/api/v2/certs/example.com?expand=current.crt", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/stitchdata/stitchdata.go b/pkg/detectors/stitchdata/stitchdata.go
index e4352db44..e980025c5 100644
--- a/pkg/detectors/stitchdata/stitchdata.go
+++ b/pkg/detectors/stitchdata/stitchdata.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.stitchdata.com/v4/sources", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.stitchdata.com/v4/sources", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
diff --git a/pkg/detectors/stockdata/stockdata.go b/pkg/detectors/stockdata/stockdata.go
index 7c79101e3..0d5ea225c 100644
--- a/pkg/detectors/stockdata/stockdata.go
+++ b/pkg/detectors/stockdata/stockdata.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.stockdata.org/v1/data/quote?symbols=AAPL,TSLA,MSFT&api_token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.stockdata.org/v1/data/quote?symbols=AAPL,TSLA,MSFT&api_token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/storecove/storecove.go b/pkg/detectors/storecove/storecove.go
index 4c9a2b835..f45e17b1e 100644
--- a/pkg/detectors/storecove/storecove.go
+++ b/pkg/detectors/storecove/storecove.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.storecove.com/api/v2/discovery/identifiers", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.storecove.com/api/v2/discovery/identifiers", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/stormglass/stormglass.go b/pkg/detectors/stormglass/stormglass.go
index acb734dea..5da4ed9ca 100644
--- a/pkg/detectors/stormglass/stormglass.go
+++ b/pkg/detectors/stormglass/stormglass.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.stormglass.io/v2/weather/point?lat=58.7984&lng=17.8081&params=windSpeed", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.stormglass.io/v2/weather/point?lat=58.7984&lng=17.8081&params=windSpeed", nil)
req.Header.Add("Authorization", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/storyblok/storyblok.go b/pkg/detectors/storyblok/storyblok.go
index 1cdf69a08..29c4a9971 100644
--- a/pkg/detectors/storyblok/storyblok.go
+++ b/pkg/detectors/storyblok/storyblok.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.storyblok.com/v1/cdn/spaces/me/?token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.storyblok.com/v1/cdn/spaces/me/?token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/storychief/storychief.go b/pkg/detectors/storychief/storychief.go
index da62e2e43..f57e33cfe 100644
--- a/pkg/detectors/storychief/storychief.go
+++ b/pkg/detectors/storychief/storychief.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.storychief.io/1.0/users?page=1&count=10", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.storychief.io/1.0/users?page=1&count=10", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/strava/strava.go b/pkg/detectors/strava/strava.go
index b8286e585..126f04101 100644
--- a/pkg/detectors/strava/strava.go
+++ b/pkg/detectors/strava/strava.go
@@ -68,7 +68,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader("grant_type=refresh_token&client_id=" + resId + "&client_secret=" + resSecret + "&refresh_token=" + resKey)
- req, _ := http.NewRequest("POST", "https://www.strava.com/oauth/token", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://www.strava.com/oauth/token", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/streak/streak.go b/pkg/detectors/streak/streak.go
index 910a8160e..2045bd649 100644
--- a/pkg/detectors/streak/streak.go
+++ b/pkg/detectors/streak/streak.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://www.streak.com/api/v1/pipelines", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.streak.com/api/v1/pipelines", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/stytch/stytch.go b/pkg/detectors/stytch/stytch.go
index 287785dee..f6fd5e8cc 100644
--- a/pkg/detectors/stytch/stytch.go
+++ b/pkg/detectors/stytch/stytch.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
fmt.Println(userPatMatch)
fmt.Println(tokenPatMatch)
- req, _ := http.NewRequest("GET", "https://api.stytch.com/v1/users/pending", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.stytch.com/v1/users/pending", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/sumologickey/sumologickey.go b/pkg/detectors/sumologickey/sumologickey.go
index a787531de..0483e7507 100644
--- a/pkg/detectors/sumologickey/sumologickey.go
+++ b/pkg/detectors/sumologickey/sumologickey.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", resIdMatch, resMatch)
encoded := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.us2.sumologic.com/api/v1/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.us2.sumologic.com/api/v1/users", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", encoded))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/surveyanyplace/surveyanyplace.go b/pkg/detectors/surveyanyplace/surveyanyplace.go
index 1f8f758d9..8806eeb6e 100644
--- a/pkg/detectors/surveyanyplace/surveyanyplace.go
+++ b/pkg/detectors/surveyanyplace/surveyanyplace.go
@@ -65,7 +65,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
"code2"
]
}`)
- req, _ := http.NewRequest("POST", "https://api.surveyanyplace.com/v1/surveys/"+resIdMatch+"/accesscodes", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.surveyanyplace.com/v1/surveys/"+resIdMatch+"/accesscodes", payload)
req.Header.Add("Authorization", fmt.Sprintf("API %s", resMatch))
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
diff --git a/pkg/detectors/surveybot/surveybot.go b/pkg/detectors/surveybot/surveybot.go
index e5a91b9d9..2ded29fb1 100644
--- a/pkg/detectors/surveybot/surveybot.go
+++ b/pkg/detectors/surveybot/surveybot.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.surveybot.io/api/v1/surveys?page=1&per_page=20&offset=0", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.surveybot.io/api/v1/surveys?page=1&per_page=20&offset=0", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("X-Api-Key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/surveysparrow/surveysparrow.go b/pkg/detectors/surveysparrow/surveysparrow.go
index 77da0b4cc..199da7447 100644
--- a/pkg/detectors/surveysparrow/surveysparrow.go
+++ b/pkg/detectors/surveysparrow/surveysparrow.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.surveysparrow.com/v1/contacts", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.surveysparrow.com/v1/contacts", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/survicate/survicate.go b/pkg/detectors/survicate/survicate.go
index 36776630e..e186ed8b8 100644
--- a/pkg/detectors/survicate/survicate.go
+++ b/pkg/detectors/survicate/survicate.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://data-api.survicate.com/v1/surveys", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://data-api.survicate.com/v1/surveys", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/swell/swell.go b/pkg/detectors/swell/swell.go
index ce2f8b3c1..4c9cba2f4 100644
--- a/pkg/detectors/swell/swell.go
+++ b/pkg/detectors/swell/swell.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(tokenPatMatch),
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.swell.store/products?limit=100", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.swell.store/products?limit=100", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/swiftype/swiftype.go b/pkg/detectors/swiftype/swiftype.go
index 2a7fc5ce5..789d6008f 100644
--- a/pkg/detectors/swiftype/swiftype.go
+++ b/pkg/detectors/swiftype/swiftype.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"auth_token":"` + resMatch + `","q": "gatsby"}`)
- req, _ := http.NewRequest("GET", "https://search-api.swiftype.com/api/v1/engines/bookstore/document_types/books/search.json", payload)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://search-api.swiftype.com/api/v1/engines/bookstore/document_types/books/search.json", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/tatumio/tatumio.go b/pkg/detectors/tatumio/tatumio.go
index 38fad0c4c..482624436 100644
--- a/pkg/detectors/tatumio/tatumio.go
+++ b/pkg/detectors/tatumio/tatumio.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api-eu1.tatum.io/v3/ledger/account?pageSize=10&offset=0&accountCode=AC_1011_B", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api-eu1.tatum.io/v3/ledger/account?pageSize=10&offset=0&accountCode=AC_1011_B", nil)
req.Header.Add("Accept", "application/vnd.tatumio+json; version=3")
req.Header.Add("x-api-key", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/taxjar/taxjar.go b/pkg/detectors/taxjar/taxjar.go
index e5311bb6e..abc5d85d1 100644
--- a/pkg/detectors/taxjar/taxjar.go
+++ b/pkg/detectors/taxjar/taxjar.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.taxjar.com/v2/categories", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.taxjar.com/v2/categories", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/teamgate/teamgate.go b/pkg/detectors/teamgate/teamgate.go
index 6c0eeca85..bf31e969f 100644
--- a/pkg/detectors/teamgate/teamgate.go
+++ b/pkg/detectors/teamgate/teamgate.go
@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(resMatch),
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.teamgate.com/v4/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.teamgate.com/v4/users", nil)
req.Header.Add("X-Auth-Token", resMatch)
req.Header.Add("X-App-Key", resKeyMatch)
diff --git a/pkg/detectors/technicalanalysisapi/technicalanalysisapi.go b/pkg/detectors/technicalanalysisapi/technicalanalysisapi.go
index 87f003c1c..3c47cc473 100644
--- a/pkg/detectors/technicalanalysisapi/technicalanalysisapi.go
+++ b/pkg/detectors/technicalanalysisapi/technicalanalysisapi.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
timeout := 10 * time.Second
client.Timeout = timeout
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://technical-analysis-api.com/api/v1/analysis/BTC?apiKey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://technical-analysis-api.com/api/v1/analysis/BTC?apiKey=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/telegrambottoken/telegrambottoken.go b/pkg/detectors/telegrambottoken/telegrambottoken.go
index 0ac2f0e29..a98d7325a 100644
--- a/pkg/detectors/telegrambottoken/telegrambottoken.go
+++ b/pkg/detectors/telegrambottoken/telegrambottoken.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
// https://core.telegram.org/bots/api#getme
- req, _ := http.NewRequest("GET", "https://api.telegram.org/bot"+key+"/getMe", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.telegram.org/bot"+key+"/getMe", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/telnyx/telnyx.go b/pkg/detectors/telnyx/telnyx.go
index acdc03508..0df411c55 100644
--- a/pkg/detectors/telnyx/telnyx.go
+++ b/pkg/detectors/telnyx/telnyx.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.telnyx.com/v2/messaging_profiles", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.telnyx.com/v2/messaging_profiles", nil)
req.Header.Add("Accept", "application/vnd.telnyx+json; version=3")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/terraformcloudpersonaltoken/terraformcloudpersonaltoken.go b/pkg/detectors/terraformcloudpersonaltoken/terraformcloudpersonaltoken.go
index d403b8b95..682a5bbcb 100644
--- a/pkg/detectors/terraformcloudpersonaltoken/terraformcloudpersonaltoken.go
+++ b/pkg/detectors/terraformcloudpersonaltoken/terraformcloudpersonaltoken.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.terraform.io/api/v2/account/details", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.terraform.io/api/v2/account/details", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/text2data/text2data.go b/pkg/detectors/text2data/text2data.go
index 5115559bd..267dd893f 100644
--- a/pkg/detectors/text2data/text2data.go
+++ b/pkg/detectors/text2data/text2data.go
@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data.Add("DocumentText", "Excellent location, opposite a very large mall with wide variety of shops, restaurants and more.")
data.Add("PrivateKey", resMatch)
- req, _ := http.NewRequest("POST", "http://api.text2data.com/v3/analyze", strings.NewReader(data.Encode()))
+ req, _ := http.NewRequestWithContext(ctx, "POST", "http://api.text2data.com/v3/analyze", strings.NewReader(data.Encode()))
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
diff --git a/pkg/detectors/textmagic/textmagic.go b/pkg/detectors/textmagic/textmagic.go
index 84c114fbb..5c6f6d188 100644
--- a/pkg/detectors/textmagic/textmagic.go
+++ b/pkg/detectors/textmagic/textmagic.go
@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", resUser, resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://rest.textmagic.com/api/v2/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://rest.textmagic.com/api/v2/user", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/thinkific/thinkific.go b/pkg/detectors/thinkific/thinkific.go
index a4be2f3f2..0066401eb 100644
--- a/pkg/detectors/thinkific/thinkific.go
+++ b/pkg/detectors/thinkific/thinkific.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
domainRes := fmt.Sprintf("%s-s-school", resDomainMatch)
- req, _ := http.NewRequest("GET", "https://api.thinkific.com/api/public/v1/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.thinkific.com/api/public/v1/users", nil)
req.Header.Add("X-Auth-API-Key", resMatch)
req.Header.Add("X-Auth-Subdomain", domainRes)
req.Header.Add("Content-Type", "application/json")
diff --git a/pkg/detectors/thousandeyes/thousandeyes.go b/pkg/detectors/thousandeyes/thousandeyes.go
index d33886ce6..69ef9bc57 100644
--- a/pkg/detectors/thousandeyes/thousandeyes.go
+++ b/pkg/detectors/thousandeyes/thousandeyes.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.thousandeyes.com/v6/endpoint-data/user-sessions/web.json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.thousandeyes.com/v6/endpoint-data/user-sessions/web.json", nil)
req.SetBasicAuth(userPatMatch, tokenPatMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/ticketmaster/ticketmaster.go b/pkg/detectors/ticketmaster/ticketmaster.go
index b5dda001c..f8f12231f 100644
--- a/pkg/detectors/ticketmaster/ticketmaster.go
+++ b/pkg/detectors/ticketmaster/ticketmaster.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://app.ticketmaster.com/discovery/v2/events.json?apikey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://app.ticketmaster.com/discovery/v2/events.json?apikey=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/tiingo/tiingo.go b/pkg/detectors/tiingo/tiingo.go
index 20e8af23b..64cd43cee 100644
--- a/pkg/detectors/tiingo/tiingo.go
+++ b/pkg/detectors/tiingo/tiingo.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.tiingo.com/tiingo/fundamentals/definitions", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.tiingo.com/tiingo/fundamentals/definitions", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Token %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/timezoneapi/timezoneapi.go b/pkg/detectors/timezoneapi/timezoneapi.go
index 8d8e765cb..97a6c51df 100644
--- a/pkg/detectors/timezoneapi/timezoneapi.go
+++ b/pkg/detectors/timezoneapi/timezoneapi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://timezoneapi.io/api/ip/?token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://timezoneapi.io/api/ip/?token="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/tly/tly.go b/pkg/detectors/tly/tly.go
index 2c86f909e..b4e4bc5e2 100644
--- a/pkg/detectors/tly/tly.go
+++ b/pkg/detectors/tly/tly.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://t.ly/api/v1/link/stats?api_token="+resMatch+"&short_url=https://t.ly/h9YS", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://t.ly/api/v1/link/stats?api_token="+resMatch+"&short_url=https://t.ly/h9YS", nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/tmetric/tmetric.go b/pkg/detectors/tmetric/tmetric.go
index ebedf9974..d0b5b204c 100644
--- a/pkg/detectors/tmetric/tmetric.go
+++ b/pkg/detectors/tmetric/tmetric.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.tmetric.com/api/v3/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.tmetric.com/api/v3/user", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/todoist/todoist.go b/pkg/detectors/todoist/todoist.go
index 2ae2b0868..5150e1e0d 100644
--- a/pkg/detectors/todoist/todoist.go
+++ b/pkg/detectors/todoist/todoist.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.todoist.com/rest/v1/projects", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.todoist.com/rest/v1/projects", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/toggltrack/toggltrack.go b/pkg/detectors/toggltrack/toggltrack.go
index 82609c145..157615dd9 100644
--- a/pkg/detectors/toggltrack/toggltrack.go
+++ b/pkg/detectors/toggltrack/toggltrack.go
@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:api_token", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.track.toggl.com/api/v8/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.track.toggl.com/api/v8/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/tomorrowio/tomorrowio.go b/pkg/detectors/tomorrowio/tomorrowio.go
index 31a279a8e..61a727a55 100644
--- a/pkg/detectors/tomorrowio/tomorrowio.go
+++ b/pkg/detectors/tomorrowio/tomorrowio.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.tomorrow.io/v4/alerts?apikey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.tomorrow.io/v4/alerts?apikey=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/tomtom/tomtom.go b/pkg/detectors/tomtom/tomtom.go
index aa5c9c38a..ca9d2c3de 100644
--- a/pkg/detectors/tomtom/tomtom.go
+++ b/pkg/detectors/tomtom/tomtom.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.tomtom.com/map/1/tile/basic/main/0/0/0.png?view=Unified&key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.tomtom.com/map/1/tile/basic/main/0/0/0.png?view=Unified&key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/tradier/tradier.go b/pkg/detectors/tradier/tradier.go
index 081ddc640..18aa09f0a 100644
--- a/pkg/detectors/tradier/tradier.go
+++ b/pkg/detectors/tradier/tradier.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.tradier.com/v1/watchlists", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.tradier.com/v1/watchlists", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/travelpayouts/travelpayouts.go b/pkg/detectors/travelpayouts/travelpayouts.go
index ebb35b584..1e32357e9 100644
--- a/pkg/detectors/travelpayouts/travelpayouts.go
+++ b/pkg/detectors/travelpayouts/travelpayouts.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.travelpayouts.com/v2/prices/latest?currency=usd&limit=5&token=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.travelpayouts.com/v2/prices/latest?currency=usd&limit=5&token=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/travisci/travisci.go b/pkg/detectors/travisci/travisci.go
index afea9bbf8..271c9779f 100644
--- a/pkg/detectors/travisci/travisci.go
+++ b/pkg/detectors/travisci/travisci.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.travis-ci.com/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.travis-ci.com/user", nil)
req.Header.Add("Authorization", fmt.Sprintf("token %s", resMatch))
req.Header.Add("User-Agent", "API Explorer")
req.Header.Add("Travis-API-Version", "3")
diff --git a/pkg/detectors/trelloapikey/trelloapikey.go b/pkg/detectors/trelloapikey/trelloapikey.go
index b39663614..0c728f637 100644
--- a/pkg/detectors/trelloapikey/trelloapikey.go
+++ b/pkg/detectors/trelloapikey/trelloapikey.go
@@ -53,7 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.trello.com/1/members/me?key="+resMatch+"&token="+token, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.trello.com/1/members/me?key="+resMatch+"&token="+token, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/tru/tru.go b/pkg/detectors/tru/tru.go
index f6195e103..0fba63ded 100644
--- a/pkg/detectors/tru/tru.go
+++ b/pkg/detectors/tru/tru.go
@@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
data := fmt.Sprintf("%s:%s", resMatch, resSecret)
baseToken := b64.StdEncoding.EncodeToString([]byte(data))
payload := strings.NewReader("grant_type=client_credentials")
- req, _ := http.NewRequest("POST", "https://eu.api.tru.id/oauth2/v1/token", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://eu.api.tru.id/oauth2/v1/token", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", baseToken))
res, err := client.Do(req)
diff --git a/pkg/detectors/twelvedata/twelvedata.go b/pkg/detectors/twelvedata/twelvedata.go
index c268d46e1..882174ab2 100644
--- a/pkg/detectors/twelvedata/twelvedata.go
+++ b/pkg/detectors/twelvedata/twelvedata.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.twelvedata.com/earliest_timestamp?symbol=AAPL&interval=1day&apikey="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.twelvedata.com/earliest_timestamp?symbol=AAPL&interval=1day&apikey="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/tyntec/tyntec.go b/pkg/detectors/tyntec/tyntec.go
index c8418287a..acf81486b 100644
--- a/pkg/detectors/tyntec/tyntec.go
+++ b/pkg/detectors/tyntec/tyntec.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.tyntec.com/2fa/v1/application", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.tyntec.com/2fa/v1/application", nil)
req.Header.Add("apiKey", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/typeform/typeform.go b/pkg/detectors/typeform/typeform.go
index f36e9984d..47c912e2f 100644
--- a/pkg/detectors/typeform/typeform.go
+++ b/pkg/detectors/typeform/typeform.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.typeform.com/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.typeform.com/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/ubidots/ubidots.go b/pkg/detectors/ubidots/ubidots.go
index 963f9aa1d..a2b9405b4 100644
--- a/pkg/detectors/ubidots/ubidots.go
+++ b/pkg/detectors/ubidots/ubidots.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://industrial.api.ubidots.com/api/v1.6/variables/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://industrial.api.ubidots.com/api/v1.6/variables/", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-Auth-Token", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/unifyid/unifyid.go b/pkg/detectors/unifyid/unifyid.go
index b6c713ac2..f9130b300 100644
--- a/pkg/detectors/unifyid/unifyid.go
+++ b/pkg/detectors/unifyid/unifyid.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"token": "sample"}`)
- req, _ := http.NewRequest("POST", "https://api.unify.id/v1/humandetect/verify", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.unify.id/v1/humandetect/verify", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/unplugg/unplugg.go b/pkg/detectors/unplugg/unplugg.go
index e3b410418..d8bbc4ce9 100644
--- a/pkg/detectors/unplugg/unplugg.go
+++ b/pkg/detectors/unplugg/unplugg.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(`{"data":[{"timestamp":1466640000,"value":0.27589941523037853},{"timestamp":1466640900,"value":0.4059699097648263}],"forecast_to":1458136800,"callback":"http://yourdomain.com/samplecallback"}`)
- req, _ := http.NewRequest("POST", "https://api.unplu.gg/forecast", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.unplu.gg/forecast", payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-access-token", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/unsplash/unsplash.go b/pkg/detectors/unsplash/unsplash.go
index 34eb67bc9..26a51bc61 100644
--- a/pkg/detectors/unsplash/unsplash.go
+++ b/pkg/detectors/unsplash/unsplash.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.unsplash.com/photos/?client_id="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.unsplash.com/photos/?client_id="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/upcdatabase/upcdatabase.go b/pkg/detectors/upcdatabase/upcdatabase.go
index 73042e33e..3325bad6c 100644
--- a/pkg/detectors/upcdatabase/upcdatabase.go
+++ b/pkg/detectors/upcdatabase/upcdatabase.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.upcdatabase.org/product/0111222333446?apikey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.upcdatabase.org/product/0111222333446?apikey=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/uplead/uplead.go b/pkg/detectors/uplead/uplead.go
index 5fe4b5ea9..913a88654 100644
--- a/pkg/detectors/uplead/uplead.go
+++ b/pkg/detectors/uplead/uplead.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.uplead.com/v2/credits", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.uplead.com/v2/credits", nil)
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/upwave/upwave.go b/pkg/detectors/upwave/upwave.go
index 431ca0757..33aec4255 100644
--- a/pkg/detectors/upwave/upwave.go
+++ b/pkg/detectors/upwave/upwave.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.upwave.io/workspaces/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.upwave.io/workspaces/", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Token %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/urlscan/urlscan.go b/pkg/detectors/urlscan/urlscan.go
index 2b7e4026b..b75edc8cd 100644
--- a/pkg/detectors/urlscan/urlscan.go
+++ b/pkg/detectors/urlscan/urlscan.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://urlscan.io/user/quotas", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://urlscan.io/user/quotas", nil)
req.Header.Add("API-Key", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/user/user.go b/pkg/detectors/user/user.go
index 2a199b746..eaf2fa507 100644
--- a/pkg/detectors/user/user.go
+++ b/pkg/detectors/user/user.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://secretscanner.user.com/api/public/users/", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://secretscanner.user.com/api/public/users/", nil)
req.Header.Add("Authorization", fmt.Sprintf("Token %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/userstack/userstack.go b/pkg/detectors/userstack/userstack.go
index fe555e6bb..81209cee5 100644
--- a/pkg/detectors/userstack/userstack.go
+++ b/pkg/detectors/userstack/userstack.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.userstack.com/detect?access_key=%s&ua=Mozilla/5.0", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.userstack.com/detect?access_key=%s&ua=Mozilla/5.0", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/vatlayer/vatlayer.go b/pkg/detectors/vatlayer/vatlayer.go
index cd3e1f310..eb81d08a0 100644
--- a/pkg/detectors/vatlayer/vatlayer.go
+++ b/pkg/detectors/vatlayer/vatlayer.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://www.apilayer.net/api/validate?access_key=%s&vat_number=LU26375245&format=1", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://www.apilayer.net/api/validate?access_key=%s&vat_number=LU26375245&format=1", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/vercel/vercel.go b/pkg/detectors/vercel/vercel.go
index 0182412f7..792d5e382 100644
--- a/pkg/detectors/vercel/vercel.go
+++ b/pkg/detectors/vercel/vercel.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.vercel.com/www/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.vercel.com/www/user", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/verifier/verifier.go b/pkg/detectors/verifier/verifier.go
index f0ef54127..8cc1f550d 100644
--- a/pkg/detectors/verifier/verifier.go
+++ b/pkg/detectors/verifier/verifier.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(resMatch),
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://verifier.meetchopra.com/verify/%s?token=%s", userPatMatch, resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://verifier.meetchopra.com/verify/%s?token=%s", userPatMatch, resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/verimail/verimail.go b/pkg/detectors/verimail/verimail.go
index 31ccad04d..1e1061f89 100644
--- a/pkg/detectors/verimail/verimail.go
+++ b/pkg/detectors/verimail/verimail.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.verimail.io/v3/verify?key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.verimail.io/v3/verify?key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/veriphone/veriphone.go b/pkg/detectors/veriphone/veriphone.go
index 47b46af6d..23ae6b24e 100644
--- a/pkg/detectors/veriphone/veriphone.go
+++ b/pkg/detectors/veriphone/veriphone.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.veriphone.io/v2/verify?phone=%252B49-15123577723&key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.veriphone.io/v2/verify?phone=%252B49-15123577723&key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/versioneye/versioneye.go b/pkg/detectors/versioneye/versioneye.go
index eeae54bb6..ae9a5dc06 100644
--- a/pkg/detectors/versioneye/versioneye.go
+++ b/pkg/detectors/versioneye/versioneye.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.versioneye.com/api/v1/scans", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.versioneye.com/api/v1/scans", nil)
req.Header.Add("apiKey", resMatch)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/viewneo/viewneo.go b/pkg/detectors/viewneo/viewneo.go
index 55e5f08af..c7a8a9d36 100644
--- a/pkg/detectors/viewneo/viewneo.go
+++ b/pkg/detectors/viewneo/viewneo.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://cloud.viewneo.com/api/v1.0/playlist", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://cloud.viewneo.com/api/v1.0/playlist", nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/virustotal/virustotal.go b/pkg/detectors/virustotal/virustotal.go
index 4bf987dd3..92bda269c 100644
--- a/pkg/detectors/virustotal/virustotal.go
+++ b/pkg/detectors/virustotal/virustotal.go
@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
writer.Close()
- req, _ := http.NewRequest("POST", "https://www.virustotal.com/api/v3/urls", bytes.NewReader(body.Bytes()))
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://www.virustotal.com/api/v3/urls", bytes.NewReader(body.Bytes()))
req.Header.Add("Content-Type", writer.FormDataContentType())
req.Header.Add("x-apikey", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/visualcrossing/visualcrossing.go b/pkg/detectors/visualcrossing/visualcrossing.go
index d26085157..31d0ebf28 100644
--- a/pkg/detectors/visualcrossing/visualcrossing.go
+++ b/pkg/detectors/visualcrossing/visualcrossing.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/LA?key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/LA?key=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/voicegain/voicegain.go b/pkg/detectors/voicegain/voicegain.go
index 6a8154a75..81b491779 100644
--- a/pkg/detectors/voicegain/voicegain.go
+++ b/pkg/detectors/voicegain/voicegain.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.voicegain.ai/v1/sa/config", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.voicegain.ai/v1/sa/config", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/vouchery/vouchery.go b/pkg/detectors/vouchery/vouchery.go
index 8dab083d5..65fa318d5 100644
--- a/pkg/detectors/vouchery/vouchery.go
+++ b/pkg/detectors/vouchery/vouchery.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://%s.vouchery.io/api/v2.0/users", subMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://%s.vouchery.io/api/v2.0/users", subMatch), nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/vpnapi/vpnapi.go b/pkg/detectors/vpnapi/vpnapi.go
index 9c8a8499c..b07e57902 100644
--- a/pkg/detectors/vpnapi/vpnapi.go
+++ b/pkg/detectors/vpnapi/vpnapi.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://vpnapi.io/api/8.8.8.8?key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://vpnapi.io/api/8.8.8.8?key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/vultrapikey/vultrapikey.go b/pkg/detectors/vultrapikey/vultrapikey.go
index f0c96643f..9822eaf55 100644
--- a/pkg/detectors/vultrapikey/vultrapikey.go
+++ b/pkg/detectors/vultrapikey/vultrapikey.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.vultr.com/v2/account", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.vultr.com/v2/account", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/vyte/vyte.go b/pkg/detectors/vyte/vyte.go
index a7e112dcb..895593ae6 100644
--- a/pkg/detectors/vyte/vyte.go
+++ b/pkg/detectors/vyte/vyte.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.vyte.in/v2/events", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.vyte.in/v2/events", nil)
req.Header.Add("Accept", "application/vnd.vyte+json; version=3")
req.Header.Add("Authorization", resMatch)
res, err := client.Do(req)
diff --git a/pkg/detectors/walkscore/walkscore.go b/pkg/detectors/walkscore/walkscore.go
index ac67ae6e6..19c4418ec 100644
--- a/pkg/detectors/walkscore/walkscore.go
+++ b/pkg/detectors/walkscore/walkscore.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://transit.walkscore.com/transit/search/stops/?lat=47.6101359&lon=-122.3420567&wsapikey=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://transit.walkscore.com/transit/search/stops/?lat=47.6101359&lon=-122.3420567&wsapikey=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/weatherbit/weatherbit.go b/pkg/detectors/weatherbit/weatherbit.go
index 04ea94f57..128392174 100644
--- a/pkg/detectors/weatherbit/weatherbit.go
+++ b/pkg/detectors/weatherbit/weatherbit.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.weatherbit.io/v2.0/history/airquality?lat=38.0&lon=-78.0&key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.weatherbit.io/v2.0/history/airquality?lat=38.0&lon=-78.0&key=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/weatherstack/weatherstack.go b/pkg/detectors/weatherstack/weatherstack.go
index 8b78b567f..96a40a6c7 100644
--- a/pkg/detectors/weatherstack/weatherstack.go
+++ b/pkg/detectors/weatherstack/weatherstack.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.weatherstack.com/current?access_key=%s&query=LA", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.weatherstack.com/current?access_key=%s&query=LA", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/webex/webex.go b/pkg/detectors/webex/webex.go
index a9f90e3d4..21b49c8f4 100644
--- a/pkg/detectors/webex/webex.go
+++ b/pkg/detectors/webex/webex.go
@@ -60,7 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader("grant_type=authorization_code&code=362ad374-735c-4f69-aa8e-bf384f8602de&client_id=" + id + "&client_secret=" + resMatch + "&redirect_uri=http%3A%2F%2Flocalhost.com%2Fb")
- req, _ := http.NewRequest("POST", "https://webexapis.com/v1/access_token", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://webexapis.com/v1/access_token", payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err != nil {
diff --git a/pkg/detectors/webflow/webflow.go b/pkg/detectors/webflow/webflow.go
index 5c8d7c108..0ee216ede 100644
--- a/pkg/detectors/webflow/webflow.go
+++ b/pkg/detectors/webflow/webflow.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.webflow.com/info", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.webflow.com/info", nil)
req.Header.Add("accept-version", "1.0.0")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/webscraper/webscraper.go b/pkg/detectors/webscraper/webscraper.go
index ee285da57..480b3b12f 100644
--- a/pkg/detectors/webscraper/webscraper.go
+++ b/pkg/detectors/webscraper/webscraper.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://api.webscraper.io/api/v1/sitemaps?api_token=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.webscraper.io/api/v1/sitemaps?api_token=%s", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/webscraping/webscraping.go b/pkg/detectors/webscraping/webscraping.go
index ea30626c4..baae364df 100644
--- a/pkg/detectors/webscraping/webscraping.go
+++ b/pkg/detectors/webscraping/webscraping.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.webscrapingapi.com/v1?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.webscrapingapi.com/v1?api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/wepay/wepay.go b/pkg/detectors/wepay/wepay.go
index 12e8de8e9..e281aed25 100644
--- a/pkg/detectors/wepay/wepay.go
+++ b/pkg/detectors/wepay/wepay.go
@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://stage-api.wepay.com/payments?type=credit_card&credit_card=4003830171874018", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://stage-api.wepay.com/payments?type=credit_card&credit_card=4003830171874018", nil)
req.Header.Add("App-Token", resMatch)
req.Header.Add("App-Id", resAppIDMatch)
req.Header.Add("Api-Version", "3.0")
diff --git a/pkg/detectors/whoxy/whoxy.go b/pkg/detectors/whoxy/whoxy.go
index c184baea8..935d2b00e 100644
--- a/pkg/detectors/whoxy/whoxy.go
+++ b/pkg/detectors/whoxy/whoxy.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.whoxy.com/?key=%s&account=balance", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.whoxy.com/?key=%s&account=balance", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/worksnaps/worksnaps.go b/pkg/detectors/worksnaps/worksnaps.go
index 356051fdd..5c8317f9a 100644
--- a/pkg/detectors/worksnaps/worksnaps.go
+++ b/pkg/detectors/worksnaps/worksnaps.go
@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:ignored", resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://api.worksnaps.com/api/projects.xml", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.worksnaps.com/api/projects.xml", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/workstack/workstack.go b/pkg/detectors/workstack/workstack.go
index 4717c909c..bdfaf74a6 100644
--- a/pkg/detectors/workstack/workstack.go
+++ b/pkg/detectors/workstack/workstack.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.workstack.io/api/team?api_token="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.workstack.io/api/team?api_token="+resMatch, nil)
req.Header.Add("Accept", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/worldcoinindex/worldcoinindex.go b/pkg/detectors/worldcoinindex/worldcoinindex.go
index 711896ca6..559789b6c 100644
--- a/pkg/detectors/worldcoinindex/worldcoinindex.go
+++ b/pkg/detectors/worldcoinindex/worldcoinindex.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://www.worldcoinindex.com/apiservice/ticker?key=%s&label=ethbtc-ltcbtc&fiat=btc", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://www.worldcoinindex.com/apiservice/ticker?key=%s&label=ethbtc-ltcbtc&fiat=btc", resMatch), nil)
res, err := client.Do(req)
if err == nil {
bodyBytes, err := ioutil.ReadAll(res.Body)
diff --git a/pkg/detectors/worldweather/worldweather.go b/pkg/detectors/worldweather/worldweather.go
index 80598fe03..ee619b259 100644
--- a/pkg/detectors/worldweather/worldweather.go
+++ b/pkg/detectors/worldweather/worldweather.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("http://api.worldweatheronline.com/premium/v1/search.ashx?query=LA&key=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://api.worldweatheronline.com/premium/v1/search.ashx?query=LA&key=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/wrike/wrike.go b/pkg/detectors/wrike/wrike.go
index 75b859016..629192e66 100644
--- a/pkg/detectors/wrike/wrike.go
+++ b/pkg/detectors/wrike/wrike.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app-us2.wrike.com/api/v4/contacts?me=true", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app-us2.wrike.com/api/v4/contacts?me=true", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/yandex/yandex.go b/pkg/detectors/yandex/yandex.go
index ef7a4e6bc..d150fd008 100644
--- a/pkg/detectors/yandex/yandex.go
+++ b/pkg/detectors/yandex/yandex.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://dictionary.yandex.net/api/v1/dicservice.json/getLangs?key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://dictionary.yandex.net/api/v1/dicservice.json/getLangs?key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/youneedabudget/youneedabudget.go b/pkg/detectors/youneedabudget/youneedabudget.go
index f5688b2ca..187e1ce05 100644
--- a/pkg/detectors/youneedabudget/youneedabudget.go
+++ b/pkg/detectors/youneedabudget/youneedabudget.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.youneedabudget.com/v1/user", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.youneedabudget.com/v1/user", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/yousign/yousign.go b/pkg/detectors/yousign/yousign.go
index 7b79737d9..b95ea3527 100644
--- a/pkg/detectors/yousign/yousign.go
+++ b/pkg/detectors/yousign/yousign.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://staging-api.yousign.com/users", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://staging-api.yousign.com/users", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
diff --git a/pkg/detectors/youtubeapikey/youtubeapikey.go b/pkg/detectors/youtubeapikey/youtubeapikey.go
index 3f679dfa5..b6ec3cbee 100644
--- a/pkg/detectors/youtubeapikey/youtubeapikey.go
+++ b/pkg/detectors/youtubeapikey/youtubeapikey.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://www.googleapis.com/youtube/v3/channelSections?key="+resMatch+"&channelId="+resIdmatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://www.googleapis.com/youtube/v3/channelSections?key="+resMatch+"&channelId="+resIdmatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/zapierwebhook/zapierwebhook.go b/pkg/detectors/zapierwebhook/zapierwebhook.go
index f38bb1226..5a468d192 100644
--- a/pkg/detectors/zapierwebhook/zapierwebhook.go
+++ b/pkg/detectors/zapierwebhook/zapierwebhook.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("POST", "https://hooks.zapier.com/hooks/catch/"+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://hooks.zapier.com/hooks/catch/"+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/zendeskapi/zendeskapi.go b/pkg/detectors/zendeskapi/zendeskapi.go
index 47ea3c3a8..31d7f8b9a 100644
--- a/pkg/detectors/zendeskapi/zendeskapi.go
+++ b/pkg/detectors/zendeskapi/zendeskapi.go
@@ -74,7 +74,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s/token:%s", resEmail, resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", "https://"+resDomain+"/api/v2/users.json", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://"+resDomain+"/api/v2/users.json", nil)
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/zenscrape/zenscrape.go b/pkg/detectors/zenscrape/zenscrape.go
index 41517d2b6..34fdf42e2 100644
--- a/pkg/detectors/zenscrape/zenscrape.go
+++ b/pkg/detectors/zenscrape/zenscrape.go
@@ -52,7 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.zenscrape.com/api/v1/get", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.zenscrape.com/api/v1/get", nil)
req.Header.Add("apikey", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/zenserp/zenserp.go b/pkg/detectors/zenserp/zenserp.go
index be96df127..2f1102d59 100644
--- a/pkg/detectors/zenserp/zenserp.go
+++ b/pkg/detectors/zenserp/zenserp.go
@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app.zenserp.com/api/v2/search?apikey="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app.zenserp.com/api/v2/search?apikey="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/zeplin/zeplin.go b/pkg/detectors/zeplin/zeplin.go
index fbd28af00..874876291 100644
--- a/pkg/detectors/zeplin/zeplin.go
+++ b/pkg/detectors/zeplin/zeplin.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.zeplin.dev/v1/users/me", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.zeplin.dev/v1/users/me", nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/zerobounce/zerobounce.go b/pkg/detectors/zerobounce/zerobounce.go
index 63d6813e1..2f262b5fd 100644
--- a/pkg/detectors/zerobounce/zerobounce.go
+++ b/pkg/detectors/zerobounce/zerobounce.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://api.zerobounce.net/v2/getcredits?api_key="+resMatch, nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://api.zerobounce.net/v2/getcredits?api_key="+resMatch, nil)
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/zipapi/zipapi.go b/pkg/detectors/zipapi/zipapi.go
index cbe7bd20c..99c31b59b 100644
--- a/pkg/detectors/zipapi/zipapi.go
+++ b/pkg/detectors/zipapi/zipapi.go
@@ -68,7 +68,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
data := fmt.Sprintf("%s:%s", resEmail, resPword)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://service.zipapi.us/zipcode/90210/?X-API-KEY=%s", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://service.zipapi.us/zipcode/90210/?X-API-KEY=%s", resMatch), nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
res, err := client.Do(req)
diff --git a/pkg/detectors/zipbooks/zipbooks.go b/pkg/detectors/zipbooks/zipbooks.go
index 0cc71eb80..22c5be641 100644
--- a/pkg/detectors/zipbooks/zipbooks.go
+++ b/pkg/detectors/zipbooks/zipbooks.go
@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if verify {
payload := strings.NewReader(fmt.Sprintf(`{"email": "%s", "password": "%s"}`, resMatch, resPword))
- req, _ := http.NewRequest("POST", "https://api.zipbooks.com/v2/auth/login", payload)
+ req, _ := http.NewRequestWithContext(ctx, "POST", "https://api.zipbooks.com/v2/auth/login", payload)
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/detectors/zipcodeapi/zipcodeapi.go b/pkg/detectors/zipcodeapi/zipcodeapi.go
index b64a20567..8d233b88d 100644
--- a/pkg/detectors/zipcodeapi/zipcodeapi.go
+++ b/pkg/detectors/zipcodeapi/zipcodeapi.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", fmt.Sprintf("https://www.zipcodeapi.com/rest/%s/distance.json/71601/72959/mile", resMatch), nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://www.zipcodeapi.com/rest/%s/distance.json/71601/72959/mile", resMatch), nil)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
diff --git a/pkg/detectors/zonkafeedback/zonkafeedback.go b/pkg/detectors/zonkafeedback/zonkafeedback.go
index 5f58c92ab..27ea0cd2c 100644
--- a/pkg/detectors/zonkafeedback/zonkafeedback.go
+++ b/pkg/detectors/zonkafeedback/zonkafeedback.go
@@ -51,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- req, _ := http.NewRequest("GET", "https://app-us1.zonkafeedback.com/responses?page=1&limit=25&startDate=2020-05-02&endDate=2020-05-09", nil)
+ req, _ := http.NewRequestWithContext(ctx, "GET", "https://app-us1.zonkafeedback.com/responses?page=1&limit=25&startDate=2020-05-02&endDate=2020-05-09", nil)
req.Header.Add("Z-API-TOKEN", fmt.Sprintf("%s", resMatch))
res, err := client.Do(req)
if err == nil {
diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go
index 161f3b36a..42f04b372 100644
--- a/pkg/engine/engine.go
+++ b/pkg/engine/engine.go
@@ -147,6 +147,8 @@ func (e *Engine) detectorWorker(ctx context.Context) {
if !foundKeyword {
continue
}
+ ctx, cancel := context.WithTimeout(ctx, time.Second*10)
+ defer cancel()
results, err := detector.FromData(ctx, verify, decoded.Data)
if err != nil {
logrus.WithError(err).Error("could not scan chunk")