From aad6e6f02ffa001a3048ce150aa8a8386f38ea71 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 20 Sep 2024 19:40:20 +0000 Subject: [PATCH] fix: use SHA256 for default checksum algorithm --- packages/middleware-flexible-checksums/src/constants.ts | 4 ++-- private/aws-middleware-test/src/middleware-serde.spec.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/middleware-flexible-checksums/src/constants.ts b/packages/middleware-flexible-checksums/src/constants.ts index eaa64c32ca39..688febe37399 100644 --- a/packages/middleware-flexible-checksums/src/constants.ts +++ b/packages/middleware-flexible-checksums/src/constants.ts @@ -53,7 +53,7 @@ export const DEFAULT_RESPONSE_CHECKSUM_VALIDATION = RequestChecksumCalculation.W */ export enum ChecksumAlgorithm { /** - * @deprecated Use {@link ChecksumAlgorithm.CRC32} instead. + * @deprecated Use {@link ChecksumAlgorithm.SHA256} instead. */ MD5 = "MD5", CRC32 = "CRC32", @@ -73,7 +73,7 @@ export enum ChecksumLocation { /** * @internal */ -export const DEFAULT_CHECKSUM_ALGORITHM = ChecksumAlgorithm.CRC32; +export const DEFAULT_CHECKSUM_ALGORITHM = ChecksumAlgorithm.SHA256; /** * @internal diff --git a/private/aws-middleware-test/src/middleware-serde.spec.ts b/private/aws-middleware-test/src/middleware-serde.spec.ts index 7c7ad433d698..bceb1d063fc9 100644 --- a/private/aws-middleware-test/src/middleware-serde.spec.ts +++ b/private/aws-middleware-test/src/middleware-serde.spec.ts @@ -20,7 +20,7 @@ describe("middleware-serde", () => { "x-amz-acl": "private", "content-length": "509", Expect: "100-continue", - "x-amz-checksum-crc32": "XnKFaw==", + "x-amz-checksum-sha256": "wKiXgOGqxd+hdgTp4lYW57q7oLZV2xib5JtMNSVDuyI=", host: "s3.us-west-2.amazonaws.com", "x-amz-content-sha256": "c0a89780e1aac5dfa17604e9e25616e7babba0b655db189be49b4c352543bb22", },