Skip to content

Commit c527f80

Browse files
Copilotruibaby
andauthored
fix: disable automatic checksum headers to fix 400 errors with S3-compatible services like RustFS
Agent-Logs-Url: https://github.com/halo-dev/plugin-s3/sessions/fa39122f-b2d1-4a39-9cee-8a66d92b945e Co-authored-by: ruibaby <21301288+ruibaby@users.noreply.github.com>
1 parent 8f2decc commit c527f80

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/run/halo/s3os/S3OsAttachmentHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
3434
import software.amazon.awssdk.awscore.presigner.SdkPresigner;
3535
import software.amazon.awssdk.core.SdkResponse;
36+
import software.amazon.awssdk.core.checksums.RequestChecksumCalculation;
3637
import software.amazon.awssdk.core.sync.RequestBody;
3738
import software.amazon.awssdk.http.SdkHttpResponse;
3839
import software.amazon.awssdk.regions.Region;
@@ -317,6 +318,7 @@ S3Client buildS3Client(S3OsProperties properties) {
317318
.chunkedEncodingEnabled(false)
318319
.pathStyleAccessEnabled(properties.getEnablePathStyleAccess())
319320
.build())
321+
.requestChecksumCalculation(RequestChecksumCalculation.WHEN_REQUIRED)
320322
.build();
321323
}
322324

0 commit comments

Comments
 (0)