Skip to content

Commit 2e261da

Browse files
committed
fixup! tmp2
1 parent 86df98f commit 2e261da

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/api/apiUtils/object/prepareStream.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const {
66
arsenalErrorFromChecksumError,
77
} = require('../../apiUtils/integrity/validateChecksums');
88
const { errors } = require('arsenal');
9+
const { unsupportedSignatureChecksums } = require('../../../../constants');
910

1011
/**
1112
* Prepares the request stream for data storage by wrapping it in the
@@ -84,6 +85,13 @@ function prepareStream(request, streamingV4Params, log, errCb) {
8485
}
8586
case 'UNSIGNED-PAYLOAD': // Fallthrough
8687
default: {
88+
if (unsupportedSignatureChecksums.has(xAmzContentSHA256)) {
89+
return {
90+
error: errors.BadRequest.customizeDescription(`${xAmzContentSHA256} is not supported`),
91+
stream: null,
92+
};
93+
}
94+
8795
const checksumedStream = new ChecksumTransform(
8896
checksumAlgo.algorithm,
8997
checksumAlgo.expected,

0 commit comments

Comments
 (0)