Skip to content

Commit fb589f4

Browse files
authored
Merge pull request #8 from redhuntlabs/get-method-fix
added client.get method instead of http.get
2 parents 79dd988 + 74507ce commit fb589f4

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

BucketLoot

64 Bytes
Binary file not shown.

scanfiles.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,15 @@ func scanS3FilesSlow(fileURLs []string, bucketURL string) error {
4646
}
4747
defer tempFile.Close()
4848

49+
client := &http.Client{
50+
CheckRedirect: func(req *http.Request, via []*http.Request) error {
51+
// You can customize redirect handling here if needed.
52+
return nil
53+
},
54+
}
55+
4956
// Make HTTP request to S3 bucket
50-
resp, err := http.Get(fileURL)
57+
resp, err := client.Get(fileURL)
5158
if err != nil {
5259
errors = append(errors, fmt.Errorf("error making HTTP request to S3 bucket file URL: %v", err))
5360
continue
@@ -259,7 +266,14 @@ func scanS3FilesFast(fileURLs []string, bucketURL string) error {
259266
go func(url string) {
260267
defer wg.Done()
261268

262-
resp, err := http.Get(url)
269+
client := &http.Client{
270+
CheckRedirect: func(req *http.Request, via []*http.Request) error {
271+
// You can customize redirect handling here if needed.
272+
return nil
273+
},
274+
}
275+
276+
resp, err := client.Get(url)
263277
if err != nil {
264278
mutex.Lock()
265279
errors = append(errors, fmt.Errorf("error making HTTP request to S3 bucket file URL: %v", err))

0 commit comments

Comments
 (0)