@aws-sdk/middleware-flexible-checksums 3.178.0 → 3.183.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist-es/flexibleChecksumsMiddleware.js +59 -58
- package/dist-es/getChecksum.js +3 -15
- package/dist-es/getChecksumAlgorithmForRequest.js +4 -5
- package/dist-es/getChecksumAlgorithmListForResponse.js +6 -19
- package/dist-es/getChecksumLocationName.js +1 -3
- package/dist-es/getFlexibleChecksumsPlugin.js +4 -4
- package/dist-es/hasHeader.js +5 -17
- package/dist-es/isStreaming.js +1 -3
- package/dist-es/selectChecksumAlgorithmFunction.js +7 -10
- package/dist-es/stringHasher.js +2 -2
- package/dist-es/types.js +2 -2
- package/dist-es/validateChecksumFromResponse.js +16 -49
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/middleware-flexible-checksums
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [3.178.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.177.0...v3.178.0) (2022-09-23)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-sdk/middleware-flexible-checksums
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { getChecksumAlgorithmForRequest } from "./getChecksumAlgorithmForRequest";
|
|
4
3
|
import { getChecksumLocationName } from "./getChecksumLocationName";
|
|
@@ -7,62 +6,64 @@ import { isStreaming } from "./isStreaming";
|
|
|
7
6
|
import { selectChecksumAlgorithmFunction } from "./selectChecksumAlgorithmFunction";
|
|
8
7
|
import { stringHasher } from "./stringHasher";
|
|
9
8
|
import { validateChecksumFromResponse } from "./validateChecksumFromResponse";
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
getAwsChunkedEncodingStream = config.getAwsChunkedEncodingStream, bodyLengthChecker = config.bodyLengthChecker;
|
|
36
|
-
updatedBody = getAwsChunkedEncodingStream(requestBody, {
|
|
37
|
-
base64Encoder: base64Encoder,
|
|
38
|
-
bodyLengthChecker: bodyLengthChecker,
|
|
39
|
-
checksumLocationName: checksumLocationName,
|
|
40
|
-
checksumAlgorithmFn: checksumAlgorithmFn,
|
|
41
|
-
streamHasher: streamHasher,
|
|
42
|
-
});
|
|
43
|
-
updatedHeaders = __assign(__assign({}, headers), { "content-encoding": "aws-chunked", "transfer-encoding": "chunked", "x-amz-decoded-content-length": headers["content-length"], "x-amz-content-sha256": "STREAMING-UNSIGNED-PAYLOAD-TRAILER", "x-amz-trailer": checksumLocationName });
|
|
44
|
-
delete updatedHeaders["content-length"];
|
|
45
|
-
return [3, 3];
|
|
46
|
-
case 1:
|
|
47
|
-
if (!!hasHeader(checksumLocationName, headers)) return [3, 3];
|
|
48
|
-
return [4, stringHasher(checksumAlgorithmFn, requestBody)];
|
|
49
|
-
case 2:
|
|
50
|
-
rawChecksum = _b.sent();
|
|
51
|
-
updatedHeaders = __assign(__assign({}, headers), (_a = {}, _a[checksumLocationName] = base64Encoder(rawChecksum), _a));
|
|
52
|
-
_b.label = 3;
|
|
53
|
-
case 3: return [4, next(__assign(__assign({}, args), { request: __assign(__assign({}, request), { headers: updatedHeaders, body: updatedBody }) }))];
|
|
54
|
-
case 4:
|
|
55
|
-
result = _b.sent();
|
|
56
|
-
requestValidationModeMember = middlewareConfig.requestValidationModeMember, responseAlgorithms = middlewareConfig.responseAlgorithms;
|
|
57
|
-
if (requestValidationModeMember && input[requestValidationModeMember] === "ENABLED") {
|
|
58
|
-
validateChecksumFromResponse(result.response, {
|
|
59
|
-
config: config,
|
|
60
|
-
responseAlgorithms: responseAlgorithms,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return [2, result];
|
|
64
|
-
}
|
|
9
|
+
export const flexibleChecksumsMiddleware = (config, middlewareConfig) => (next) => async (args) => {
|
|
10
|
+
if (!HttpRequest.isInstance(args.request)) {
|
|
11
|
+
return next(args);
|
|
12
|
+
}
|
|
13
|
+
const { request } = args;
|
|
14
|
+
const { body: requestBody, headers } = request;
|
|
15
|
+
const { base64Encoder, streamHasher } = config;
|
|
16
|
+
const { input, requestChecksumRequired, requestAlgorithmMember } = middlewareConfig;
|
|
17
|
+
const checksumAlgorithm = getChecksumAlgorithmForRequest(input, {
|
|
18
|
+
requestChecksumRequired,
|
|
19
|
+
requestAlgorithmMember,
|
|
20
|
+
});
|
|
21
|
+
let updatedBody = requestBody;
|
|
22
|
+
let updatedHeaders = headers;
|
|
23
|
+
if (checksumAlgorithm) {
|
|
24
|
+
const checksumLocationName = getChecksumLocationName(checksumAlgorithm);
|
|
25
|
+
const checksumAlgorithmFn = selectChecksumAlgorithmFunction(checksumAlgorithm, config);
|
|
26
|
+
if (isStreaming(requestBody)) {
|
|
27
|
+
const { getAwsChunkedEncodingStream, bodyLengthChecker } = config;
|
|
28
|
+
updatedBody = getAwsChunkedEncodingStream(requestBody, {
|
|
29
|
+
base64Encoder,
|
|
30
|
+
bodyLengthChecker,
|
|
31
|
+
checksumLocationName,
|
|
32
|
+
checksumAlgorithmFn,
|
|
33
|
+
streamHasher,
|
|
65
34
|
});
|
|
66
|
-
|
|
67
|
-
|
|
35
|
+
updatedHeaders = {
|
|
36
|
+
...headers,
|
|
37
|
+
"content-encoding": "aws-chunked",
|
|
38
|
+
"transfer-encoding": "chunked",
|
|
39
|
+
"x-amz-decoded-content-length": headers["content-length"],
|
|
40
|
+
"x-amz-content-sha256": "STREAMING-UNSIGNED-PAYLOAD-TRAILER",
|
|
41
|
+
"x-amz-trailer": checksumLocationName,
|
|
42
|
+
};
|
|
43
|
+
delete updatedHeaders["content-length"];
|
|
44
|
+
}
|
|
45
|
+
else if (!hasHeader(checksumLocationName, headers)) {
|
|
46
|
+
const rawChecksum = await stringHasher(checksumAlgorithmFn, requestBody);
|
|
47
|
+
updatedHeaders = {
|
|
48
|
+
...headers,
|
|
49
|
+
[checksumLocationName]: base64Encoder(rawChecksum),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const result = await next({
|
|
54
|
+
...args,
|
|
55
|
+
request: {
|
|
56
|
+
...request,
|
|
57
|
+
headers: updatedHeaders,
|
|
58
|
+
body: updatedBody,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
const { requestValidationModeMember, responseAlgorithms } = middlewareConfig;
|
|
62
|
+
if (requestValidationModeMember && input[requestValidationModeMember] === "ENABLED") {
|
|
63
|
+
validateChecksumFromResponse(result.response, {
|
|
64
|
+
config,
|
|
65
|
+
responseAlgorithms,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
68
69
|
};
|
package/dist-es/getChecksum.js
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import { __awaiter, __generator } from "tslib";
|
|
2
1
|
import { isStreaming } from "./isStreaming";
|
|
3
2
|
import { stringHasher } from "./stringHasher";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
return
|
|
7
|
-
var digest, _b;
|
|
8
|
-
return __generator(this, function (_c) {
|
|
9
|
-
switch (_c.label) {
|
|
10
|
-
case 0:
|
|
11
|
-
digest = isStreaming(body) ? streamHasher(checksumAlgorithmFn, body) : stringHasher(checksumAlgorithmFn, body);
|
|
12
|
-
_b = base64Encoder;
|
|
13
|
-
return [4, digest];
|
|
14
|
-
case 1: return [2, _b.apply(void 0, [_c.sent()])];
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
});
|
|
3
|
+
export const getChecksum = async (body, { streamHasher, checksumAlgorithmFn, base64Encoder }) => {
|
|
4
|
+
const digest = isStreaming(body) ? streamHasher(checksumAlgorithmFn, body) : stringHasher(checksumAlgorithmFn, body);
|
|
5
|
+
return base64Encoder(await digest);
|
|
18
6
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ChecksumAlgorithm } from "./constants";
|
|
2
2
|
import { CLIENT_SUPPORTED_ALGORITHMS } from "./types";
|
|
3
|
-
export
|
|
4
|
-
var requestChecksumRequired = _a.requestChecksumRequired, requestAlgorithmMember = _a.requestAlgorithmMember;
|
|
3
|
+
export const getChecksumAlgorithmForRequest = (input, { requestChecksumRequired, requestAlgorithmMember }) => {
|
|
5
4
|
if (!requestAlgorithmMember || !input[requestAlgorithmMember]) {
|
|
6
5
|
return requestChecksumRequired ? ChecksumAlgorithm.MD5 : undefined;
|
|
7
6
|
}
|
|
8
|
-
|
|
7
|
+
const checksumAlgorithm = input[requestAlgorithmMember];
|
|
9
8
|
if (!CLIENT_SUPPORTED_ALGORITHMS.includes(checksumAlgorithm)) {
|
|
10
|
-
throw new Error(
|
|
11
|
-
|
|
9
|
+
throw new Error(`The checksum algorithm "${checksumAlgorithm}" is not supported by the client.` +
|
|
10
|
+
` Select one of ${CLIENT_SUPPORTED_ALGORITHMS}.`);
|
|
12
11
|
}
|
|
13
12
|
return checksumAlgorithm;
|
|
14
13
|
};
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import { __values } from "tslib";
|
|
2
1
|
import { CLIENT_SUPPORTED_ALGORITHMS, PRIORITY_ORDER_ALGORITHMS } from "./types";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var PRIORITY_ORDER_ALGORITHMS_1 = __values(PRIORITY_ORDER_ALGORITHMS), PRIORITY_ORDER_ALGORITHMS_1_1 = PRIORITY_ORDER_ALGORITHMS_1.next(); !PRIORITY_ORDER_ALGORITHMS_1_1.done; PRIORITY_ORDER_ALGORITHMS_1_1 = PRIORITY_ORDER_ALGORITHMS_1.next()) {
|
|
9
|
-
var algorithm = PRIORITY_ORDER_ALGORITHMS_1_1.value;
|
|
10
|
-
if (!responseAlgorithms.includes(algorithm) || !CLIENT_SUPPORTED_ALGORITHMS.includes(algorithm)) {
|
|
11
|
-
continue;
|
|
12
|
-
}
|
|
13
|
-
validChecksumAlgorithms.push(algorithm);
|
|
2
|
+
export const getChecksumAlgorithmListForResponse = (responseAlgorithms = []) => {
|
|
3
|
+
const validChecksumAlgorithms = [];
|
|
4
|
+
for (const algorithm of PRIORITY_ORDER_ALGORITHMS) {
|
|
5
|
+
if (!responseAlgorithms.includes(algorithm) || !CLIENT_SUPPORTED_ALGORITHMS.includes(algorithm)) {
|
|
6
|
+
continue;
|
|
14
7
|
}
|
|
15
|
-
|
|
16
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
17
|
-
finally {
|
|
18
|
-
try {
|
|
19
|
-
if (PRIORITY_ORDER_ALGORITHMS_1_1 && !PRIORITY_ORDER_ALGORITHMS_1_1.done && (_a = PRIORITY_ORDER_ALGORITHMS_1.return)) _a.call(PRIORITY_ORDER_ALGORITHMS_1);
|
|
20
|
-
}
|
|
21
|
-
finally { if (e_1) throw e_1.error; }
|
|
8
|
+
validChecksumAlgorithms.push(algorithm);
|
|
22
9
|
}
|
|
23
10
|
return validChecksumAlgorithms;
|
|
24
11
|
};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { ChecksumAlgorithm } from "./constants";
|
|
2
|
-
export
|
|
3
|
-
return algorithm === ChecksumAlgorithm.MD5 ? "content-md5" : "x-amz-checksum-".concat(algorithm.toLowerCase());
|
|
4
|
-
};
|
|
2
|
+
export const getChecksumLocationName = (algorithm) => algorithm === ChecksumAlgorithm.MD5 ? "content-md5" : `x-amz-checksum-${algorithm.toLowerCase()}`;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { flexibleChecksumsMiddleware } from "./flexibleChecksumsMiddleware";
|
|
2
|
-
export
|
|
2
|
+
export const flexibleChecksumsMiddlewareOptions = {
|
|
3
3
|
name: "flexibleChecksumsMiddleware",
|
|
4
4
|
step: "build",
|
|
5
5
|
tags: ["BODY_CHECKSUM"],
|
|
6
6
|
override: true,
|
|
7
7
|
};
|
|
8
|
-
export
|
|
9
|
-
applyToStack:
|
|
8
|
+
export const getFlexibleChecksumsPlugin = (config, middlewareConfig) => ({
|
|
9
|
+
applyToStack: (clientStack) => {
|
|
10
10
|
clientStack.add(flexibleChecksumsMiddleware(config, middlewareConfig), flexibleChecksumsMiddlewareOptions);
|
|
11
11
|
},
|
|
12
|
-
});
|
|
12
|
+
});
|
package/dist-es/hasHeader.js
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
for (var _b = __values(Object.keys(headers)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7
|
-
var headerName = _c.value;
|
|
8
|
-
if (soughtHeader === headerName.toLowerCase()) {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
1
|
+
export const hasHeader = (header, headers) => {
|
|
2
|
+
const soughtHeader = header.toLowerCase();
|
|
3
|
+
for (const headerName of Object.keys(headers)) {
|
|
4
|
+
if (soughtHeader === headerName.toLowerCase()) {
|
|
5
|
+
return true;
|
|
11
6
|
}
|
|
12
7
|
}
|
|
13
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
14
|
-
finally {
|
|
15
|
-
try {
|
|
16
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
17
|
-
}
|
|
18
|
-
finally { if (e_1) throw e_1.error; }
|
|
19
|
-
}
|
|
20
8
|
return false;
|
|
21
9
|
};
|
package/dist-es/isStreaming.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { isArrayBuffer } from "@aws-sdk/is-array-buffer";
|
|
2
|
-
export
|
|
3
|
-
return body !== undefined && typeof body !== "string" && !ArrayBuffer.isView(body) && !isArrayBuffer(body);
|
|
4
|
-
};
|
|
2
|
+
export const isStreaming = (body) => body !== undefined && typeof body !== "string" && !ArrayBuffer.isView(body) && !isArrayBuffer(body);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { AwsCrc32 } from "@aws-crypto/crc32";
|
|
2
2
|
import { AwsCrc32c } from "@aws-crypto/crc32c";
|
|
3
3
|
import { ChecksumAlgorithm } from "./constants";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
_a[ChecksumAlgorithm.SHA256] = config.sha256,
|
|
12
|
-
_a)[checksumAlgorithm]);
|
|
13
|
-
};
|
|
4
|
+
export const selectChecksumAlgorithmFunction = (checksumAlgorithm, config) => ({
|
|
5
|
+
[ChecksumAlgorithm.MD5]: config.md5,
|
|
6
|
+
[ChecksumAlgorithm.CRC32]: AwsCrc32,
|
|
7
|
+
[ChecksumAlgorithm.CRC32C]: AwsCrc32c,
|
|
8
|
+
[ChecksumAlgorithm.SHA1]: config.sha1,
|
|
9
|
+
[ChecksumAlgorithm.SHA256]: config.sha256,
|
|
10
|
+
}[checksumAlgorithm]);
|
package/dist-es/stringHasher.js
CHANGED
package/dist-es/types.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ChecksumAlgorithm } from "./constants";
|
|
2
|
-
export
|
|
2
|
+
export const CLIENT_SUPPORTED_ALGORITHMS = [
|
|
3
3
|
ChecksumAlgorithm.CRC32,
|
|
4
4
|
ChecksumAlgorithm.CRC32C,
|
|
5
5
|
ChecksumAlgorithm.SHA1,
|
|
6
6
|
ChecksumAlgorithm.SHA256,
|
|
7
7
|
];
|
|
8
|
-
export
|
|
8
|
+
export const PRIORITY_ORDER_ALGORITHMS = [
|
|
9
9
|
ChecksumAlgorithm.CRC32,
|
|
10
10
|
ChecksumAlgorithm.CRC32C,
|
|
11
11
|
ChecksumAlgorithm.SHA1,
|
|
@@ -1,55 +1,22 @@
|
|
|
1
|
-
import { __awaiter, __generator, __values } from "tslib";
|
|
2
1
|
import { getChecksum } from "./getChecksum";
|
|
3
2
|
import { getChecksumAlgorithmListForResponse } from "./getChecksumAlgorithmListForResponse";
|
|
4
3
|
import { getChecksumLocationName } from "./getChecksumLocationName";
|
|
5
4
|
import { selectChecksumAlgorithmFunction } from "./selectChecksumAlgorithmFunction";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
_c.trys.push([1, 6, 7, 8]);
|
|
19
|
-
checksumAlgorithms_1 = __values(checksumAlgorithms), checksumAlgorithms_1_1 = checksumAlgorithms_1.next();
|
|
20
|
-
_c.label = 2;
|
|
21
|
-
case 2:
|
|
22
|
-
if (!!checksumAlgorithms_1_1.done) return [3, 5];
|
|
23
|
-
algorithm = checksumAlgorithms_1_1.value;
|
|
24
|
-
responseHeader = getChecksumLocationName(algorithm);
|
|
25
|
-
checksumFromResponse = responseHeaders[responseHeader];
|
|
26
|
-
if (!checksumFromResponse) return [3, 4];
|
|
27
|
-
checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
|
|
28
|
-
streamHasher = config.streamHasher, base64Encoder = config.base64Encoder;
|
|
29
|
-
return [4, getChecksum(responseBody, { streamHasher: streamHasher, checksumAlgorithmFn: checksumAlgorithmFn, base64Encoder: base64Encoder })];
|
|
30
|
-
case 3:
|
|
31
|
-
checksum = _c.sent();
|
|
32
|
-
if (checksum === checksumFromResponse) {
|
|
33
|
-
return [3, 5];
|
|
34
|
-
}
|
|
35
|
-
throw new Error("Checksum mismatch: expected \"".concat(checksum, "\" but received \"").concat(checksumFromResponse, "\"") +
|
|
36
|
-
" in response header \"".concat(responseHeader, "\"."));
|
|
37
|
-
case 4:
|
|
38
|
-
checksumAlgorithms_1_1 = checksumAlgorithms_1.next();
|
|
39
|
-
return [3, 2];
|
|
40
|
-
case 5: return [3, 8];
|
|
41
|
-
case 6:
|
|
42
|
-
e_1_1 = _c.sent();
|
|
43
|
-
e_1 = { error: e_1_1 };
|
|
44
|
-
return [3, 8];
|
|
45
|
-
case 7:
|
|
46
|
-
try {
|
|
47
|
-
if (checksumAlgorithms_1_1 && !checksumAlgorithms_1_1.done && (_b = checksumAlgorithms_1.return)) _b.call(checksumAlgorithms_1);
|
|
48
|
-
}
|
|
49
|
-
finally { if (e_1) throw e_1.error; }
|
|
50
|
-
return [7];
|
|
51
|
-
case 8: return [2];
|
|
5
|
+
export const validateChecksumFromResponse = async (response, { config, responseAlgorithms }) => {
|
|
6
|
+
const checksumAlgorithms = getChecksumAlgorithmListForResponse(responseAlgorithms);
|
|
7
|
+
const { body: responseBody, headers: responseHeaders } = response;
|
|
8
|
+
for (const algorithm of checksumAlgorithms) {
|
|
9
|
+
const responseHeader = getChecksumLocationName(algorithm);
|
|
10
|
+
const checksumFromResponse = responseHeaders[responseHeader];
|
|
11
|
+
if (checksumFromResponse) {
|
|
12
|
+
const checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
|
|
13
|
+
const { streamHasher, base64Encoder } = config;
|
|
14
|
+
const checksum = await getChecksum(responseBody, { streamHasher, checksumAlgorithmFn, base64Encoder });
|
|
15
|
+
if (checksum === checksumFromResponse) {
|
|
16
|
+
break;
|
|
52
17
|
}
|
|
53
|
-
|
|
54
|
-
|
|
18
|
+
throw new Error(`Checksum mismatch: expected "${checksum}" but received "${checksumFromResponse}"` +
|
|
19
|
+
` in response header "${responseHeader}".`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
55
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-flexible-checksums",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.183.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@aws-crypto/crc32": "2.0.0",
|
|
24
24
|
"@aws-crypto/crc32c": "2.0.0",
|
|
25
|
-
"@aws-sdk/is-array-buffer": "3.
|
|
26
|
-
"@aws-sdk/protocol-http": "3.
|
|
27
|
-
"@aws-sdk/types": "3.
|
|
25
|
+
"@aws-sdk/is-array-buffer": "3.183.0",
|
|
26
|
+
"@aws-sdk/protocol-http": "3.183.0",
|
|
27
|
+
"@aws-sdk/types": "3.183.0",
|
|
28
28
|
"tslib": "^2.3.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|