Skip to content

Commit

Permalink
fix: honor httpChecksumRequired in sigv2
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP committed Sep 30, 2021
1 parent 7efca93 commit 6d8988a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 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
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 6d8988a

Please sign in to comment.