Skip to content

Commit

Permalink
object/s3: parse credentials using the default HTTP client (#5231)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro authored Oct 21, 2024
1 parent c8fb8ae commit 406c486
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/object/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ func newS3(endpoint, accessKey, secretKey, token string) (ObjectStorage, error)
awsConfig := &aws.Config{
Region: &region,
DisableSSL: aws.Bool(!ssl),
HTTPClient: httpClient,
}

disable100Continue := strings.EqualFold(uri.Query().Get("disable-100-continue"), "true")
Expand Down Expand Up @@ -567,7 +566,7 @@ func newS3(endpoint, accessKey, secretKey, token string) (ObjectStorage, error)
return nil, fmt.Errorf("Fail to create aws session: %s", err)
}
ses.Handlers.Build.PushFront(disableSha256Func)
return &s3client{bucket: bucketName, s3: s3.New(ses), ses: ses, disableChecksum: disableChecksum}, nil
return &s3client{bucket: bucketName, s3: s3.New(ses, aws.NewConfig().WithHTTPClient(httpClient)), ses: ses, disableChecksum: disableChecksum}, nil
}

func init() {
Expand Down

0 comments on commit 406c486

Please sign in to comment.