Skip to content

Commit

Permalink
fix: honor httpChecksumRequired in sigv2 (#3905)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP authored Oct 5, 2021
1 parent af5475f commit 7cfe19f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-Signer-bb5ba0f7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "Signer",
"description": "Fix the bug that httpChecksumRequired trait is not honored in SigV2"
}
1 change: 0 additions & 1 deletion lib/event_listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ AWS.EventListeners = {
operation.httpChecksumRequired &&
req.service.config.computeChecksums &&
isNonStreamingPayload &&
req.service.getSignerClass(req) === AWS.Signers.V4 &&
!headers['Content-MD5']
) {
var md5 = AWS.util.crypto.md5(body, 'base64');
Expand Down
15 changes: 0 additions & 15 deletions lib/services/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,21 +430,6 @@ AWS.util.update(AWS.S3.prototype, {
}
},

/**
* @api private
*/
computableChecksumOperations: {
putBucketCors: true,
putBucketLifecycle: true,
putBucketLifecycleConfiguration: true,
putBucketTagging: true,
deleteObjects: true,
putBucketReplication: true,
putObjectLegalHold: true,
putObjectRetention: true,
putObjectLockConfiguration: true
},

/**
* Checks whether checksums should be computed for the request if it's not
* already set by {AWS.EventListeners.Core.COMPUTE_CHECKSUM}. It depends on
Expand Down
14 changes: 7 additions & 7 deletions scripts/region-checker/allowlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ var allowlist = {
254,
267,
273,
644,
646,
765,
776,
777,
778,
783
629,
631,
750,
761,
762,
763,
768
]
};

Expand Down
12 changes: 12 additions & 0 deletions test/event_listeners.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7cfe19f

Please sign in to comment.