From 406c4861ffa79c2997012e3c526c6304d7abc97e Mon Sep 17 00:00:00 2001 From: zhijian Date: Mon, 21 Oct 2024 11:10:07 +0800 Subject: [PATCH] object/s3: parse credentials using the default HTTP client (#5231) --- pkg/object/s3.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/object/s3.go b/pkg/object/s3.go index 7740557943a0..1205b761fc2e 100644 --- a/pkg/object/s3.go +++ b/pkg/object/s3.go @@ -534,7 +534,6 @@ func newS3(endpoint, accessKey, secretKey, token string) (ObjectStorage, error) awsConfig := &aws.Config{ Region: ®ion, DisableSSL: aws.Bool(!ssl), - HTTPClient: httpClient, } disable100Continue := strings.EqualFold(uri.Query().Get("disable-100-continue"), "true") @@ -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() {