@aws-sdk/middleware-flexible-checksums 3.662.0 → 3.666.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/dist-cjs/index.js
CHANGED
|
@@ -123,6 +123,7 @@ var NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = {
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
// src/flexibleChecksumsMiddleware.ts
|
|
126
|
+
var import_core = require("@aws-sdk/core");
|
|
126
127
|
var import_protocol_http = require("@smithy/protocol-http");
|
|
127
128
|
|
|
128
129
|
// src/types.ts
|
|
@@ -217,6 +218,20 @@ var flexibleChecksumsMiddleware = /* @__PURE__ */ __name((config, middlewareConf
|
|
|
217
218
|
let updatedBody = requestBody;
|
|
218
219
|
let updatedHeaders = headers;
|
|
219
220
|
if (checksumAlgorithm) {
|
|
221
|
+
switch (checksumAlgorithm) {
|
|
222
|
+
case "CRC32" /* CRC32 */:
|
|
223
|
+
(0, import_core.setFeature)(context, "FLEXIBLE_CHECKSUMS_REQ_CRC32", "U");
|
|
224
|
+
break;
|
|
225
|
+
case "CRC32C" /* CRC32C */:
|
|
226
|
+
(0, import_core.setFeature)(context, "FLEXIBLE_CHECKSUMS_REQ_CRC32C", "V");
|
|
227
|
+
break;
|
|
228
|
+
case "SHA1" /* SHA1 */:
|
|
229
|
+
(0, import_core.setFeature)(context, "FLEXIBLE_CHECKSUMS_REQ_SHA1", "X");
|
|
230
|
+
break;
|
|
231
|
+
case "SHA256" /* SHA256 */:
|
|
232
|
+
(0, import_core.setFeature)(context, "FLEXIBLE_CHECKSUMS_REQ_SHA256", "Y");
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
220
235
|
const checksumLocationName = getChecksumLocationName(checksumAlgorithm);
|
|
221
236
|
const checksumAlgorithmFn = selectChecksumAlgorithmFunction(checksumAlgorithm, config);
|
|
222
237
|
if (isStreaming(requestBody)) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { setFeature } from "@aws-sdk/core";
|
|
1
2
|
import { HttpRequest } from "@smithy/protocol-http";
|
|
3
|
+
import { ChecksumAlgorithm } from "./constants";
|
|
2
4
|
import { getChecksumAlgorithmForRequest } from "./getChecksumAlgorithmForRequest";
|
|
3
5
|
import { getChecksumLocationName } from "./getChecksumLocationName";
|
|
4
6
|
import { hasHeader } from "./hasHeader";
|
|
@@ -26,6 +28,20 @@ export const flexibleChecksumsMiddleware = (config, middlewareConfig) => (next,
|
|
|
26
28
|
let updatedBody = requestBody;
|
|
27
29
|
let updatedHeaders = headers;
|
|
28
30
|
if (checksumAlgorithm) {
|
|
31
|
+
switch (checksumAlgorithm) {
|
|
32
|
+
case ChecksumAlgorithm.CRC32:
|
|
33
|
+
setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_CRC32", "U");
|
|
34
|
+
break;
|
|
35
|
+
case ChecksumAlgorithm.CRC32C:
|
|
36
|
+
setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_CRC32C", "V");
|
|
37
|
+
break;
|
|
38
|
+
case ChecksumAlgorithm.SHA1:
|
|
39
|
+
setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_SHA1", "X");
|
|
40
|
+
break;
|
|
41
|
+
case ChecksumAlgorithm.SHA256:
|
|
42
|
+
setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_SHA256", "Y");
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
29
45
|
const checksumLocationName = getChecksumLocationName(checksumAlgorithm);
|
|
30
46
|
const checksumAlgorithmFn = selectChecksumAlgorithmFunction(checksumAlgorithm, config);
|
|
31
47
|
if (isStreaming(requestBody)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-flexible-checksums",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.666.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline middleware-flexible-checksums",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@aws-crypto/crc32": "5.2.0",
|
|
32
32
|
"@aws-crypto/crc32c": "5.2.0",
|
|
33
|
-
"@aws-sdk/
|
|
33
|
+
"@aws-sdk/core": "3.666.0",
|
|
34
|
+
"@aws-sdk/types": "3.664.0",
|
|
34
35
|
"@smithy/is-array-buffer": "^3.0.0",
|
|
35
36
|
"@smithy/node-config-provider": "^3.1.8",
|
|
36
37
|
"@smithy/protocol-http": "^4.1.4",
|