Skip to content

Commit

Permalink
fix localstack checksum error in ci. aws/aws-sdk-net#3610
Browse files Browse the repository at this point in the history
  • Loading branch information
nhulston committed Feb 3, 2025
1 parent dc83a86 commit 6fca491
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ string content
Key = objectKey,
UploadId = uploadId,
PartNumber = partNumber,
InputStream = memoryStream
InputStream = memoryStream,
};

var response = await s3Client.UploadPartAsync(uploadRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ private static async Task Main(string[] args)

private static AmazonS3Client GetAmazonS3Client()
{
// Fixes localstack breaking change in AWSSSDK.S3 versions 3.7.412.0 and above.
// https://github.com/aws/aws-sdk-net/issues/3610
Environment.SetEnvironmentVariable("AWS_REQUEST_CHECKSUM_CALCULATION", "WHEN_REQUIRED");

if (Environment.GetEnvironmentVariable("AWS_ACCESSKEY") is string accessKey &&
Environment.GetEnvironmentVariable("AWS_SECRETKEY") is string secretKey &&
Environment.GetEnvironmentVariable("AWS_REGION") is string region)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ string content
Key = objectKey,
UploadId = uploadId,
PartNumber = partNumber,
InputStream = memoryStream
InputStream = memoryStream,
};

var response = s3Client.UploadPart(request);
Expand Down

0 comments on commit 6fca491

Please sign in to comment.