Add context timeout to scanners

This commit is contained in:
Dustin Decker
2022-02-07 11:15:48 -08:00
parent ee99f0c9a2
commit 79496b8142
571 changed files with 586 additions and 572 deletions
+1 -1
View File
@@ -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()