From c411cc4bc87f3394ca7485898c85148b054a6e3e Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Wed, 12 Jul 2023 12:09:57 +0800 Subject: [PATCH] s3 cos --- pkg/common/db/s3/cos/cos.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkg/common/db/s3/cos/cos.go b/pkg/common/db/s3/cos/cos.go index ed4a48676..b353b0ba2 100644 --- a/pkg/common/db/s3/cos/cos.go +++ b/pkg/common/db/s3/cos/cos.go @@ -33,15 +33,10 @@ func NewCos() (s3.Interface, error) { SessionToken: conf.SessionToken, }, }) - statObjectURL := u.String() - if statObjectURL != "" && statObjectURL[len(statObjectURL)-1] != '/' { - statObjectURL += "/" - } return &Cos{ - statObjectURL: statObjectURL, - copyURL: u.Host + "/", - client: client, - credential: client.GetCredential(), + copyURL: u.Host + "/", + client: client, + credential: client.GetCredential(), }, nil } @@ -65,7 +60,6 @@ func (c *Cos) PartLimit() *s3.PartLimit { } func (c *Cos) InitiateMultipartUpload(ctx context.Context, name string) (*s3.InitiateMultipartUploadResult, error) { - name = c.client.BaseURL.BucketURL.String() + name result, _, err := c.client.Object.InitiateMultipartUpload(ctx, name, nil) if err != nil { return nil, err