Skip to content

Commit 8c7d3d9

Browse files
committed
fix: initialize http client in retry loop
1 parent 20514a4 commit 8c7d3d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ func GetLatestURL(url string, retryAttempts uint) (archiveUrl string, exists boo
3636
resp := http.Response{}
3737
// This obliterates the `http` namespace so it must come after
3838
// creating the response object.
39-
http := http.Client{}
4039
if err := retry.Do(func() error {
40+
http := http.Client{}
4141
resp, err := http.Get(archiveApi + "/wayback/available?url=" + url)
4242
if err != nil {
4343
return fmt.Errorf("error calling wayback api: %w", err)

0 commit comments

Comments
 (0)