Add context timeout to scanners
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user