@aws-sdk/middleware-sdk-s3 3.744.0 → 3.750.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
|
@@ -57,11 +57,12 @@ module.exports = __toCommonJS(src_exports);
|
|
|
57
57
|
var import_protocol_http = require("@smithy/protocol-http");
|
|
58
58
|
var import_smithy_client = require("@smithy/smithy-client");
|
|
59
59
|
var CONTENT_LENGTH_HEADER = "content-length";
|
|
60
|
+
var DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length";
|
|
60
61
|
function checkContentLengthHeader() {
|
|
61
62
|
return (next, context) => async (args) => {
|
|
62
63
|
const { request } = args;
|
|
63
64
|
if (import_protocol_http.HttpRequest.isInstance(request)) {
|
|
64
|
-
if (!(CONTENT_LENGTH_HEADER in request.headers)) {
|
|
65
|
+
if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) {
|
|
65
66
|
const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`;
|
|
66
67
|
if (typeof context?.logger?.warn === "function" && !(context.logger instanceof import_smithy_client.NoOpLogger)) {
|
|
67
68
|
context.logger.warn(message);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { HttpRequest } from "@smithy/protocol-http";
|
|
2
2
|
import { NoOpLogger } from "@smithy/smithy-client";
|
|
3
3
|
const CONTENT_LENGTH_HEADER = "content-length";
|
|
4
|
+
const DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length";
|
|
4
5
|
export function checkContentLengthHeader() {
|
|
5
6
|
return (next, context) => async (args) => {
|
|
6
7
|
const { request } = args;
|
|
7
8
|
if (HttpRequest.isInstance(request)) {
|
|
8
|
-
if (!(CONTENT_LENGTH_HEADER in request.headers)) {
|
|
9
|
+
if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) {
|
|
9
10
|
const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`;
|
|
10
11
|
if (typeof context?.logger?.warn === "function" && !(context.logger instanceof NoOpLogger)) {
|
|
11
12
|
context.logger.warn(message);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-sdk-s3",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.750.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-sdk-s3",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@aws-sdk/core": "3.
|
|
30
|
+
"@aws-sdk/core": "3.750.0",
|
|
31
31
|
"@aws-sdk/types": "3.734.0",
|
|
32
32
|
"@aws-sdk/util-arn-parser": "3.723.0",
|
|
33
|
-
"@smithy/core": "^3.1.
|
|
33
|
+
"@smithy/core": "^3.1.4",
|
|
34
34
|
"@smithy/node-config-provider": "^4.0.1",
|
|
35
35
|
"@smithy/protocol-http": "^5.0.1",
|
|
36
36
|
"@smithy/signature-v4": "^5.0.1",
|
|
37
|
-
"@smithy/smithy-client": "^4.1.
|
|
37
|
+
"@smithy/smithy-client": "^4.1.5",
|
|
38
38
|
"@smithy/types": "^4.1.0",
|
|
39
39
|
"@smithy/util-config-provider": "^4.0.0",
|
|
40
40
|
"@smithy/util-middleware": "^4.0.1",
|
|
41
|
-
"@smithy/util-stream": "^4.
|
|
41
|
+
"@smithy/util-stream": "^4.1.1",
|
|
42
42
|
"@smithy/util-utf8": "^4.0.0",
|
|
43
43
|
"tslib": "^2.6.2"
|
|
44
44
|
},
|