From 00a09d6c56b52e54c380ce7f15548ba47d7c7ef5 Mon Sep 17 00:00:00 2001 From: "bingxiang.cheng" Date: Mon, 13 Apr 2026 14:41:38 +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=BB=A5=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E4=B8=8D=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/application/service/file/oss.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/application/service/file/oss.go b/internal/application/service/file/oss.go index b146673e..1c0579d8 100644 --- a/internal/application/service/file/oss.go +++ b/internal/application/service/file/oss.go @@ -39,6 +39,10 @@ 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)