From 12001f23bf00b2fb4bb4e0c4ddd1a06467d6b972 Mon Sep 17 00:00:00 2001 From: "bingxiang.cheng" Date: Mon, 13 Apr 2026 14:51:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(oss):=20=E7=A6=81=E7=94=A8OSS=20S3=E5=85=BC?= =?UTF-8?q?=E5=AE=B9API=E7=9A=84=E8=87=AA=E5=8A=A8=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E5=92=8C=E8=AE=A1=E7=AE=97=EF=BC=8C=E4=BF=AE=E5=A4=8D=E7=AD=BE?= =?UTF-8?q?=E5=90=8D=E4=B8=8D=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B7=AF=E5=BE=84=E6=A0=B7=E5=BC=8F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/application/service/file/oss.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/application/service/file/oss.go b/internal/application/service/file/oss.go index 1c0579d8..4c36bb1a 100644 --- a/internal/application/service/file/oss.go +++ b/internal/application/service/file/oss.go @@ -39,10 +39,6 @@ func newOSSClient(endpoint, region, accessKey, secretKey string) (*s3.Client, er cfg, err := config.LoadDefaultConfig(context.Background(), config.WithRegion(region), config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(accessKey, secretKey, "")), - // OSS S3-compatible API does not support AWS-specific checksum headers. - // Disable automatic checksum calculation/validation to prevent signature mismatch (403). - config.WithRequestChecksumCalculation(aws.RequestChecksumCalculationWhenRequired), - config.WithResponseChecksumValidation(aws.ResponseChecksumValidationWhenRequired), ) if err != nil { return nil, fmt.Errorf("failed to load AWS config: %w", err) @@ -50,7 +46,7 @@ func newOSSClient(endpoint, region, accessKey, secretKey string) (*s3.Client, er client := s3.NewFromConfig(cfg, func(o *s3.Options) { o.BaseEndpoint = aws.String(endpoint) - o.UsePathStyle = true + o.UsePathStyle = false }) return client, nil