@aws-amplify/storage 6.10.1 → 6.10.2-unstable.1fe3c5d.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.
@@ -101,10 +101,6 @@ exports.getObject = (0, composers_1.composeServiceApi)(utils_2.s3TransferHandler
101
101
  const getPresignedGetObjectUrl = async (config, input) => {
102
102
  const endpoint = base_1.defaultConfig.endpointResolver(config, input);
103
103
  const { url, headers, method } = await getObjectSerializer(input, endpoint);
104
- // TODO: set content sha256 query parameter with value of UNSIGNED-PAYLOAD instead of empty hash.
105
- // It requires changes in presignUrl. Without this change, the generated url still works,
106
- // but not the same as other tools like AWS SDK and CLI.
107
- url.searchParams.append(utils_2.CONTENT_SHA256_HEADER, aws_client_utils_1.EMPTY_SHA256_HASH);
108
104
  if (config.userAgentValue) {
109
105
  url.searchParams.append(config.userAgentHeader ?? USER_AGENT_HEADER, config.userAgentValue);
110
106
  }
@@ -117,7 +113,7 @@ const getPresignedGetObjectUrl = async (config, input) => {
117
113
  for (const [headerName, value] of Object.entries(headers).sort(([key1], [key2]) => key1.localeCompare(key2))) {
118
114
  url.searchParams.append(headerName, value);
119
115
  }
120
- return (0, aws_client_utils_1.presignUrl)({ method, url, body: undefined }, {
116
+ return (0, aws_client_utils_1.presignUrl)({ method, url, body: aws_client_utils_1.UNSIGNED_PAYLOAD }, {
121
117
  signingService: base_1.defaultConfig.service,
122
118
  signingRegion: config.region,
123
119
  ...base_1.defaultConfig,
@@ -1 +1 @@
1
- {"version":3,"file":"getObject.js","sources":["../../../../../../../src/providers/s3/utils/client/s3data/getObject.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getPresignedGetObjectUrl = exports.getObject = void 0;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst composers_1 = require(\"@aws-amplify/core/internals/aws-client-utils/composers\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst utils_2 = require(\"../utils\");\nconst validateObjectUrl_1 = require(\"../../validateObjectUrl\");\nconst base_1 = require(\"./base\");\nconst USER_AGENT_HEADER = 'x-amz-user-agent';\nconst getObjectSerializer = async (input, endpoint) => {\n const url = new utils_1.AmplifyUrl(endpoint.url.toString());\n (0, utils_2.validateS3RequiredParameter)(!!input.Key, 'Key');\n url.pathname = (0, utils_2.serializePathnameObjectKey)(url, input.Key);\n url.search = new utils_1.AmplifyUrlSearchParams({\n 'x-id': 'GetObject',\n }).toString();\n (0, validateObjectUrl_1.validateObjectUrl)({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n return {\n method: 'GET',\n headers: {\n ...(input.Range && { Range: input.Range }),\n ...(0, utils_2.assignStringVariables)({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n }),\n },\n url,\n };\n};\nconst getObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n throw (0, utils_2.buildStorageServiceError)((await (0, base_1.parseXmlError)(response)));\n }\n else {\n return {\n ...(0, utils_2.map)(response.headers, {\n DeleteMarker: ['x-amz-delete-marker', utils_2.deserializeBoolean],\n AcceptRanges: 'accept-ranges',\n Expiration: 'x-amz-expiration',\n Restore: 'x-amz-restore',\n LastModified: ['last-modified', utils_2.deserializeTimestamp],\n ContentLength: ['content-length', utils_2.deserializeNumber],\n ETag: 'etag',\n ChecksumCRC32: 'x-amz-checksum-crc32',\n ChecksumCRC32C: 'x-amz-checksum-crc32c',\n ChecksumSHA1: 'x-amz-checksum-sha1',\n ChecksumSHA256: 'x-amz-checksum-sha256',\n ChecksumType: 'x-amz-checksum-type',\n MissingMeta: ['x-amz-missing-meta', utils_2.deserializeNumber],\n VersionId: 'x-amz-version-id',\n CacheControl: 'cache-control',\n ContentDisposition: 'content-disposition',\n ContentEncoding: 'content-encoding',\n ContentLanguage: 'content-language',\n ContentRange: 'content-range',\n ContentType: 'content-type',\n Expires: ['expires', utils_2.deserializeTimestamp],\n WebsiteRedirectLocation: 'x-amz-website-redirect-location',\n ServerSideEncryption: 'x-amz-server-side-encryption',\n SSECustomerAlgorithm: 'x-amz-server-side-encryption-customer-algorithm',\n SSECustomerKeyMD5: 'x-amz-server-side-encryption-customer-key-md5',\n SSEKMSKeyId: 'x-amz-server-side-encryption-aws-kms-key-id',\n BucketKeyEnabled: [\n 'x-amz-server-side-encryption-bucket-key-enabled',\n utils_2.deserializeBoolean,\n ],\n StorageClass: 'x-amz-storage-class',\n RequestCharged: 'x-amz-request-charged',\n ReplicationStatus: 'x-amz-replication-status',\n PartsCount: ['x-amz-mp-parts-count', utils_2.deserializeNumber],\n TagCount: ['x-amz-tagging-count', utils_2.deserializeNumber],\n ObjectLockMode: 'x-amz-object-lock-mode',\n ObjectLockRetainUntilDate: [\n 'x-amz-object-lock-retain-until-date',\n utils_2.deserializeTimestamp,\n ],\n ObjectLockLegalHoldStatus: 'x-amz-object-lock-legal-hold',\n }),\n Metadata: (0, utils_2.deserializeMetadata)(response.headers),\n $metadata: (0, aws_client_utils_1.parseMetadata)(response),\n // @ts-expect-error The body is a CompatibleHttpResponse type because the lower-level handler is XHR instead of\n // fetch, which represents payload in Blob instread of ReadableStream.\n Body: response.body,\n };\n }\n};\nexports.getObject = (0, composers_1.composeServiceApi)(utils_2.s3TransferHandler, getObjectSerializer, getObjectDeserializer, { ...base_1.defaultConfig, responseType: 'blob' });\n/**\n * Get a presigned URL for the `getObject` API.\n *\n * @internal\n */\nconst getPresignedGetObjectUrl = async (config, input) => {\n const endpoint = base_1.defaultConfig.endpointResolver(config, input);\n const { url, headers, method } = await getObjectSerializer(input, endpoint);\n // TODO: set content sha256 query parameter with value of UNSIGNED-PAYLOAD instead of empty hash.\n // It requires changes in presignUrl. Without this change, the generated url still works,\n // but not the same as other tools like AWS SDK and CLI.\n url.searchParams.append(utils_2.CONTENT_SHA256_HEADER, aws_client_utils_1.EMPTY_SHA256_HASH);\n if (config.userAgentValue) {\n url.searchParams.append(config.userAgentHeader ?? USER_AGENT_HEADER, config.userAgentValue);\n }\n if (input.ResponseContentType) {\n url.searchParams.append('response-content-type', input.ResponseContentType);\n }\n if (input.ResponseContentDisposition) {\n url.searchParams.append('response-content-disposition', input.ResponseContentDisposition);\n }\n for (const [headerName, value] of Object.entries(headers).sort(([key1], [key2]) => key1.localeCompare(key2))) {\n url.searchParams.append(headerName, value);\n }\n return (0, aws_client_utils_1.presignUrl)({ method, url, body: undefined }, {\n signingService: base_1.defaultConfig.service,\n signingRegion: config.region,\n ...base_1.defaultConfig,\n ...config,\n });\n};\nexports.getPresignedGetObjectUrl = getPresignedGetObjectUrl;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,SAAS,GAAG,MAAM;AAC7D,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC;AAClF,MAAM,WAAW,GAAG,OAAO,CAAC,wDAAwD,CAAC;AACrF,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,mBAAmB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,iBAAiB,GAAG,kBAAkB;AAC5C,MAAM,mBAAmB,GAAG,OAAO,KAAK,EAAE,QAAQ,KAAK;AACvD,IAAI,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC/D,IAAI,IAAI,OAAO,CAAC,2BAA2B,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,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AI,iBAAiB,EAAE,MAAM,CAAC,cAAc,CAAC;AACnG,IAAI;AACJ,IAAI,IAAI,KAAK,CAAC,mBAAmB,EAAE;AACnC,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAuB,EAAE,KAAK,CAAC,mBAAmB,CAAC;AACnF,IAAI;AACJ,IAAI,IAAI,KAAK,CAAC,0BAA0B,EAAE;AAC1C,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,8BAA8B,EAAE,KAAK,CAAC,0BAA0B,CAAC;AACjG,IAAI;AACJ,IAAI,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE;AAClH,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC;AAClD,IAAI;AACJ,IAAI,OAAO,IAAI,kBAAkB,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;AAChF,QAAQ,cAAc,EAAE,MAAM,CAAC,aAAa,CAAC,OAAO;AACpD,QAAQ,aAAa,EAAE,MAAM,CAAC,MAAM;AACpC,QAAQ,GAAG,MAAM,CAAC,aAAa;AAC/B,QAAQ,GAAG,MAAM;AACjB,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,wBAAwB,GAAG,wBAAwB;;"}
1
+ {"version":3,"file":"getObject.js","sources":["../../../../../../../src/providers/s3/utils/client/s3data/getObject.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getPresignedGetObjectUrl = exports.getObject = void 0;\nconst aws_client_utils_1 = require(\"@aws-amplify/core/internals/aws-client-utils\");\nconst composers_1 = require(\"@aws-amplify/core/internals/aws-client-utils/composers\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst utils_2 = require(\"../utils\");\nconst validateObjectUrl_1 = require(\"../../validateObjectUrl\");\nconst base_1 = require(\"./base\");\nconst USER_AGENT_HEADER = 'x-amz-user-agent';\nconst getObjectSerializer = async (input, endpoint) => {\n const url = new utils_1.AmplifyUrl(endpoint.url.toString());\n (0, utils_2.validateS3RequiredParameter)(!!input.Key, 'Key');\n url.pathname = (0, utils_2.serializePathnameObjectKey)(url, input.Key);\n url.search = new utils_1.AmplifyUrlSearchParams({\n 'x-id': 'GetObject',\n }).toString();\n (0, validateObjectUrl_1.validateObjectUrl)({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n return {\n method: 'GET',\n headers: {\n ...(input.Range && { Range: input.Range }),\n ...(0, utils_2.assignStringVariables)({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n }),\n },\n url,\n };\n};\nconst getObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n throw (0, utils_2.buildStorageServiceError)((await (0, base_1.parseXmlError)(response)));\n }\n else {\n return {\n ...(0, utils_2.map)(response.headers, {\n DeleteMarker: ['x-amz-delete-marker', utils_2.deserializeBoolean],\n AcceptRanges: 'accept-ranges',\n Expiration: 'x-amz-expiration',\n Restore: 'x-amz-restore',\n LastModified: ['last-modified', utils_2.deserializeTimestamp],\n ContentLength: ['content-length', utils_2.deserializeNumber],\n ETag: 'etag',\n ChecksumCRC32: 'x-amz-checksum-crc32',\n ChecksumCRC32C: 'x-amz-checksum-crc32c',\n ChecksumSHA1: 'x-amz-checksum-sha1',\n ChecksumSHA256: 'x-amz-checksum-sha256',\n ChecksumType: 'x-amz-checksum-type',\n MissingMeta: ['x-amz-missing-meta', utils_2.deserializeNumber],\n VersionId: 'x-amz-version-id',\n CacheControl: 'cache-control',\n ContentDisposition: 'content-disposition',\n ContentEncoding: 'content-encoding',\n ContentLanguage: 'content-language',\n ContentRange: 'content-range',\n ContentType: 'content-type',\n Expires: ['expires', utils_2.deserializeTimestamp],\n WebsiteRedirectLocation: 'x-amz-website-redirect-location',\n ServerSideEncryption: 'x-amz-server-side-encryption',\n SSECustomerAlgorithm: 'x-amz-server-side-encryption-customer-algorithm',\n SSECustomerKeyMD5: 'x-amz-server-side-encryption-customer-key-md5',\n SSEKMSKeyId: 'x-amz-server-side-encryption-aws-kms-key-id',\n BucketKeyEnabled: [\n 'x-amz-server-side-encryption-bucket-key-enabled',\n utils_2.deserializeBoolean,\n ],\n StorageClass: 'x-amz-storage-class',\n RequestCharged: 'x-amz-request-charged',\n ReplicationStatus: 'x-amz-replication-status',\n PartsCount: ['x-amz-mp-parts-count', utils_2.deserializeNumber],\n TagCount: ['x-amz-tagging-count', utils_2.deserializeNumber],\n ObjectLockMode: 'x-amz-object-lock-mode',\n ObjectLockRetainUntilDate: [\n 'x-amz-object-lock-retain-until-date',\n utils_2.deserializeTimestamp,\n ],\n ObjectLockLegalHoldStatus: 'x-amz-object-lock-legal-hold',\n }),\n Metadata: (0, utils_2.deserializeMetadata)(response.headers),\n $metadata: (0, aws_client_utils_1.parseMetadata)(response),\n // @ts-expect-error The body is a CompatibleHttpResponse type because the lower-level handler is XHR instead of\n // fetch, which represents payload in Blob instread of ReadableStream.\n Body: response.body,\n };\n }\n};\nexports.getObject = (0, composers_1.composeServiceApi)(utils_2.s3TransferHandler, getObjectSerializer, getObjectDeserializer, { ...base_1.defaultConfig, responseType: 'blob' });\n/**\n * Get a presigned URL for the `getObject` API.\n *\n * @internal\n */\nconst getPresignedGetObjectUrl = async (config, input) => {\n const endpoint = base_1.defaultConfig.endpointResolver(config, input);\n const { url, headers, method } = await getObjectSerializer(input, endpoint);\n if (config.userAgentValue) {\n url.searchParams.append(config.userAgentHeader ?? USER_AGENT_HEADER, config.userAgentValue);\n }\n if (input.ResponseContentType) {\n url.searchParams.append('response-content-type', input.ResponseContentType);\n }\n if (input.ResponseContentDisposition) {\n url.searchParams.append('response-content-disposition', input.ResponseContentDisposition);\n }\n for (const [headerName, value] of Object.entries(headers).sort(([key1], [key2]) => key1.localeCompare(key2))) {\n url.searchParams.append(headerName, value);\n }\n return (0, aws_client_utils_1.presignUrl)({ method, url, body: aws_client_utils_1.UNSIGNED_PAYLOAD }, {\n signingService: base_1.defaultConfig.service,\n signingRegion: config.region,\n ...base_1.defaultConfig,\n ...config,\n });\n};\nexports.getPresignedGetObjectUrl = getPresignedGetObjectUrl;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,SAAS,GAAG,MAAM;AAC7D,MAAM,kBAAkB,GAAG,OAAO,CAAC,8CAA8C,CAAC;AAClF,MAAM,WAAW,GAAG,OAAO,CAAC,wDAAwD,CAAC;AACrF,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,mBAAmB,GAAG,OAAO,CAAC,yBAAyB,CAAC;AAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,iBAAiB,GAAG,kBAAkB;AAC5C,MAAM,mBAAmB,GAAG,OAAO,KAAK,EAAE,QAAQ,KAAK;AACvD,IAAI,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC/D,IAAI,IAAI,OAAO,CAAC,2BAA2B,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC;AAChE,IAAI,GAAG,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAC,0BAA0B,EAAE,GAAG,EAAE,KAAK,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,IAAI,KAAK,CAAC,0BAA0B,EAAE;AAC1C,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,8BAA8B,EAAE,KAAK,CAAC,0BAA0B,CAAC;AACjG,IAAI;AACJ,IAAI,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE;AAClH,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC;AAClD,IAAI;AACJ,IAAI,OAAO,IAAI,kBAAkB,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,kBAAkB,CAAC,gBAAgB,EAAE,EAAE;AAC1G,QAAQ,cAAc,EAAE,MAAM,CAAC,aAAa,CAAC,OAAO;AACpD,QAAQ,aAAa,EAAE,MAAM,CAAC,MAAM;AACpC,QAAQ,GAAG,MAAM,CAAC,aAAa;AAC/B,QAAQ,GAAG,MAAM;AACjB,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,wBAAwB,GAAG,wBAAwB;;"}
@@ -1,7 +1,6 @@
1
- import { parseMetadata, EMPTY_SHA256_HASH, presignUrl } from '@aws-amplify/core/internals/aws-client-utils';
1
+ import { parseMetadata, presignUrl, UNSIGNED_PAYLOAD } from '@aws-amplify/core/internals/aws-client-utils';
2
2
  import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';
3
3
  import { AmplifyUrl, AmplifyUrlSearchParams } from '@aws-amplify/core/internals/utils';
4
- import { CONTENT_SHA256_HEADER } from '../runtime/constants.mjs';
5
4
  import { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';
6
5
  import 'fast-xml-parser';
7
6
  import '../runtime/s3TransferHandler/xhr.mjs';
@@ -104,10 +103,6 @@ const getObject = composeServiceApi(s3TransferHandler, getObjectSerializer, getO
104
103
  const getPresignedGetObjectUrl = async (config, input) => {
105
104
  const endpoint = defaultConfig.endpointResolver(config, input);
106
105
  const { url, headers, method } = await getObjectSerializer(input, endpoint);
107
- // TODO: set content sha256 query parameter with value of UNSIGNED-PAYLOAD instead of empty hash.
108
- // It requires changes in presignUrl. Without this change, the generated url still works,
109
- // but not the same as other tools like AWS SDK and CLI.
110
- url.searchParams.append(CONTENT_SHA256_HEADER, EMPTY_SHA256_HASH);
111
106
  if (config.userAgentValue) {
112
107
  url.searchParams.append(config.userAgentHeader ?? USER_AGENT_HEADER, config.userAgentValue);
113
108
  }
@@ -120,7 +115,7 @@ const getPresignedGetObjectUrl = async (config, input) => {
120
115
  for (const [headerName, value] of Object.entries(headers).sort(([key1], [key2]) => key1.localeCompare(key2))) {
121
116
  url.searchParams.append(headerName, value);
122
117
  }
123
- return presignUrl({ method, url, body: undefined }, {
118
+ return presignUrl({ method, url, body: UNSIGNED_PAYLOAD }, {
124
119
  signingService: defaultConfig.service,
125
120
  signingRegion: config.region,
126
121
  ...defaultConfig,
@@ -1 +1 @@
1
- {"version":3,"file":"getObject.mjs","sources":["../../../../../../../src/providers/s3/utils/client/s3data/getObject.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { EMPTY_SHA256_HASH, parseMetadata, presignUrl, } from '@aws-amplify/core/internals/aws-client-utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { AmplifyUrl, AmplifyUrlSearchParams, } from '@aws-amplify/core/internals/utils';\nimport { CONTENT_SHA256_HEADER, assignStringVariables, buildStorageServiceError, deserializeBoolean, deserializeMetadata, deserializeNumber, deserializeTimestamp, map, s3TransferHandler, serializePathnameObjectKey, validateS3RequiredParameter, } from '../utils';\nimport { validateObjectUrl } from '../../validateObjectUrl';\nimport { defaultConfig, parseXmlError, } from './base';\nconst USER_AGENT_HEADER = 'x-amz-user-agent';\nconst getObjectSerializer = async (input, endpoint) => {\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n url.search = new AmplifyUrlSearchParams({\n 'x-id': 'GetObject',\n }).toString();\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n return {\n method: 'GET',\n headers: {\n ...(input.Range && { Range: input.Range }),\n ...assignStringVariables({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n }),\n },\n url,\n };\n};\nconst getObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n throw buildStorageServiceError((await parseXmlError(response)));\n }\n else {\n return {\n ...map(response.headers, {\n DeleteMarker: ['x-amz-delete-marker', deserializeBoolean],\n AcceptRanges: 'accept-ranges',\n Expiration: 'x-amz-expiration',\n Restore: 'x-amz-restore',\n LastModified: ['last-modified', deserializeTimestamp],\n ContentLength: ['content-length', deserializeNumber],\n ETag: 'etag',\n ChecksumCRC32: 'x-amz-checksum-crc32',\n ChecksumCRC32C: 'x-amz-checksum-crc32c',\n ChecksumSHA1: 'x-amz-checksum-sha1',\n ChecksumSHA256: 'x-amz-checksum-sha256',\n ChecksumType: 'x-amz-checksum-type',\n MissingMeta: ['x-amz-missing-meta', deserializeNumber],\n VersionId: 'x-amz-version-id',\n CacheControl: 'cache-control',\n ContentDisposition: 'content-disposition',\n ContentEncoding: 'content-encoding',\n ContentLanguage: 'content-language',\n ContentRange: 'content-range',\n ContentType: 'content-type',\n Expires: ['expires', deserializeTimestamp],\n WebsiteRedirectLocation: 'x-amz-website-redirect-location',\n ServerSideEncryption: 'x-amz-server-side-encryption',\n SSECustomerAlgorithm: 'x-amz-server-side-encryption-customer-algorithm',\n SSECustomerKeyMD5: 'x-amz-server-side-encryption-customer-key-md5',\n SSEKMSKeyId: 'x-amz-server-side-encryption-aws-kms-key-id',\n BucketKeyEnabled: [\n 'x-amz-server-side-encryption-bucket-key-enabled',\n deserializeBoolean,\n ],\n StorageClass: 'x-amz-storage-class',\n RequestCharged: 'x-amz-request-charged',\n ReplicationStatus: 'x-amz-replication-status',\n PartsCount: ['x-amz-mp-parts-count', deserializeNumber],\n TagCount: ['x-amz-tagging-count', deserializeNumber],\n ObjectLockMode: 'x-amz-object-lock-mode',\n ObjectLockRetainUntilDate: [\n 'x-amz-object-lock-retain-until-date',\n deserializeTimestamp,\n ],\n ObjectLockLegalHoldStatus: 'x-amz-object-lock-legal-hold',\n }),\n Metadata: deserializeMetadata(response.headers),\n $metadata: parseMetadata(response),\n // @ts-expect-error The body is a CompatibleHttpResponse type because the lower-level handler is XHR instead of\n // fetch, which represents payload in Blob instread of ReadableStream.\n Body: response.body,\n };\n }\n};\nexport const getObject = composeServiceApi(s3TransferHandler, getObjectSerializer, getObjectDeserializer, { ...defaultConfig, responseType: 'blob' });\n/**\n * Get a presigned URL for the `getObject` API.\n *\n * @internal\n */\nexport const getPresignedGetObjectUrl = async (config, input) => {\n const endpoint = defaultConfig.endpointResolver(config, input);\n const { url, headers, method } = await getObjectSerializer(input, endpoint);\n // TODO: set content sha256 query parameter with value of UNSIGNED-PAYLOAD instead of empty hash.\n // It requires changes in presignUrl. Without this change, the generated url still works,\n // but not the same as other tools like AWS SDK and CLI.\n url.searchParams.append(CONTENT_SHA256_HEADER, EMPTY_SHA256_HASH);\n if (config.userAgentValue) {\n url.searchParams.append(config.userAgentHeader ?? USER_AGENT_HEADER, config.userAgentValue);\n }\n if (input.ResponseContentType) {\n url.searchParams.append('response-content-type', input.ResponseContentType);\n }\n if (input.ResponseContentDisposition) {\n url.searchParams.append('response-content-disposition', input.ResponseContentDisposition);\n }\n for (const [headerName, value] of Object.entries(headers).sort(([key1], [key2]) => key1.localeCompare(key2))) {\n url.searchParams.append(headerName, value);\n }\n return presignUrl({ method, url, body: undefined }, {\n signingService: defaultConfig.service,\n signingRegion: config.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AAC;AACnG,IAAI;AACJ,IAAI,IAAI,KAAK,CAAC,mBAAmB,EAAE;AACnC,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAuB,EAAE,KAAK,CAAC,mBAAmB,CAAC;AACnF,IAAI;AACJ,IAAI,IAAI,KAAK,CAAC,0BAA0B,EAAE;AAC1C,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,8BAA8B,EAAE,KAAK,CAAC,0BAA0B,CAAC;AACjG,IAAI;AACJ,IAAI,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE;AAClH,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC;AAClD,IAAI;AACJ,IAAI,OAAO,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;AACxD,QAAQ,cAAc,EAAE,aAAa,CAAC,OAAO;AAC7C,QAAQ,aAAa,EAAE,MAAM,CAAC,MAAM;AACpC,QAAQ,GAAG,aAAa;AACxB,QAAQ,GAAG,MAAM;AACjB,KAAK,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"getObject.mjs","sources":["../../../../../../../src/providers/s3/utils/client/s3data/getObject.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { UNSIGNED_PAYLOAD, parseMetadata, presignUrl, } from '@aws-amplify/core/internals/aws-client-utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { AmplifyUrl, AmplifyUrlSearchParams, } from '@aws-amplify/core/internals/utils';\nimport { assignStringVariables, buildStorageServiceError, deserializeBoolean, deserializeMetadata, deserializeNumber, deserializeTimestamp, map, s3TransferHandler, serializePathnameObjectKey, validateS3RequiredParameter, } from '../utils';\nimport { validateObjectUrl } from '../../validateObjectUrl';\nimport { defaultConfig, parseXmlError, } from './base';\nconst USER_AGENT_HEADER = 'x-amz-user-agent';\nconst getObjectSerializer = async (input, endpoint) => {\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n url.search = new AmplifyUrlSearchParams({\n 'x-id': 'GetObject',\n }).toString();\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n return {\n method: 'GET',\n headers: {\n ...(input.Range && { Range: input.Range }),\n ...assignStringVariables({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n }),\n },\n url,\n };\n};\nconst getObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n throw buildStorageServiceError((await parseXmlError(response)));\n }\n else {\n return {\n ...map(response.headers, {\n DeleteMarker: ['x-amz-delete-marker', deserializeBoolean],\n AcceptRanges: 'accept-ranges',\n Expiration: 'x-amz-expiration',\n Restore: 'x-amz-restore',\n LastModified: ['last-modified', deserializeTimestamp],\n ContentLength: ['content-length', deserializeNumber],\n ETag: 'etag',\n ChecksumCRC32: 'x-amz-checksum-crc32',\n ChecksumCRC32C: 'x-amz-checksum-crc32c',\n ChecksumSHA1: 'x-amz-checksum-sha1',\n ChecksumSHA256: 'x-amz-checksum-sha256',\n ChecksumType: 'x-amz-checksum-type',\n MissingMeta: ['x-amz-missing-meta', deserializeNumber],\n VersionId: 'x-amz-version-id',\n CacheControl: 'cache-control',\n ContentDisposition: 'content-disposition',\n ContentEncoding: 'content-encoding',\n ContentLanguage: 'content-language',\n ContentRange: 'content-range',\n ContentType: 'content-type',\n Expires: ['expires', deserializeTimestamp],\n WebsiteRedirectLocation: 'x-amz-website-redirect-location',\n ServerSideEncryption: 'x-amz-server-side-encryption',\n SSECustomerAlgorithm: 'x-amz-server-side-encryption-customer-algorithm',\n SSECustomerKeyMD5: 'x-amz-server-side-encryption-customer-key-md5',\n SSEKMSKeyId: 'x-amz-server-side-encryption-aws-kms-key-id',\n BucketKeyEnabled: [\n 'x-amz-server-side-encryption-bucket-key-enabled',\n deserializeBoolean,\n ],\n StorageClass: 'x-amz-storage-class',\n RequestCharged: 'x-amz-request-charged',\n ReplicationStatus: 'x-amz-replication-status',\n PartsCount: ['x-amz-mp-parts-count', deserializeNumber],\n TagCount: ['x-amz-tagging-count', deserializeNumber],\n ObjectLockMode: 'x-amz-object-lock-mode',\n ObjectLockRetainUntilDate: [\n 'x-amz-object-lock-retain-until-date',\n deserializeTimestamp,\n ],\n ObjectLockLegalHoldStatus: 'x-amz-object-lock-legal-hold',\n }),\n Metadata: deserializeMetadata(response.headers),\n $metadata: parseMetadata(response),\n // @ts-expect-error The body is a CompatibleHttpResponse type because the lower-level handler is XHR instead of\n // fetch, which represents payload in Blob instread of ReadableStream.\n Body: response.body,\n };\n }\n};\nexport const getObject = composeServiceApi(s3TransferHandler, getObjectSerializer, getObjectDeserializer, { ...defaultConfig, responseType: 'blob' });\n/**\n * Get a presigned URL for the `getObject` API.\n *\n * @internal\n */\nexport const getPresignedGetObjectUrl = async (config, input) => {\n const endpoint = defaultConfig.endpointResolver(config, input);\n const { url, headers, method } = await getObjectSerializer(input, endpoint);\n if (config.userAgentValue) {\n url.searchParams.append(config.userAgentHeader ?? USER_AGENT_HEADER, config.userAgentValue);\n }\n if (input.ResponseContentType) {\n url.searchParams.append('response-content-type', input.ResponseContentType);\n }\n if (input.ResponseContentDisposition) {\n url.searchParams.append('response-content-disposition', input.ResponseContentDisposition);\n }\n for (const [headerName, value] of Object.entries(headers).sort(([key1], [key2]) => key1.localeCompare(key2))) {\n url.searchParams.append(headerName, value);\n }\n return presignUrl({ method, url, body: UNSIGNED_PAYLOAD }, {\n signingService: defaultConfig.service,\n signingRegion: config.region,\n ...def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AM,CAAC,uBAAuB,EAAE,KAAK,CAAC,mBAAmB,CAAC;AACnF,IAAI;AACJ,IAAI,IAAI,KAAK,CAAC,0BAA0B,EAAE;AAC1C,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,8BAA8B,EAAE,KAAK,CAAC,0BAA0B,CAAC;AACjG,IAAI;AACJ,IAAI,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE;AAClH,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC;AAClD,IAAI;AACJ,IAAI,OAAO,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE;AAC/D,QAAQ,cAAc,EAAE,aAAa,CAAC,OAAO;AAC7C,QAAQ,aAAa,EAAE,MAAM,CAAC,MAAM;AACpC,QAAQ,GAAG,aAAa;AACxB,QAAQ,GAAG,MAAM;AACjB,KAAK,CAAC;AACN;;;;"}
package/package.json CHANGED
@@ -1,119 +1,119 @@
1
1
  {
2
- "name": "@aws-amplify/storage",
3
- "version": "6.10.1",
4
- "description": "Storage category of aws-amplify",
5
- "main": "./dist/cjs/index.js",
6
- "module": "./dist/esm/index.mjs",
7
- "react-native": {
8
- "./dist/cjs/index": "./src/index.ts",
9
- "fast-xml-parser": "fast-xml-parser",
10
- "buffer": "buffer"
11
- },
12
- "typings": "./dist/esm/index.d.ts",
13
- "browser": {
14
- "./dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs": "./dist/esm/providers/s3/utils/client/runtime/base64/index.browser.mjs",
15
- "./dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/fetch.mjs": "./dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.mjs",
16
- "./dist/esm/providers/s3/utils/client/runtime/xmlParser/pureJs.mjs": "./dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs",
17
- "fast-xml-parser": false,
18
- "buffer": false
19
- },
20
- "sideEffects": false,
21
- "publishConfig": {
22
- "access": "public"
23
- },
24
- "scripts": {
25
- "test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
26
- "build-with-test": "npm test && npm run build",
27
- "build:umd": "webpack && webpack --config ./webpack.config.dev.js",
28
- "build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
29
- "build:watch": "npm run build:esm-cjs -- --watch",
30
- "build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
31
- "clean": "npm run clean:size && rimraf lib-esm lib dist",
32
- "clean:size": "rimraf dual-publish-tmp tmp*",
33
- "format": "echo \"Not implemented\"",
34
- "lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
35
- "lint:fix": "eslint '**/*.{ts,tsx}' --fix",
36
- "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 90.31"
37
- },
38
- "typesVersions": {
39
- ">=4.2": {
40
- "s3": [
41
- "./dist/esm/providers/s3/index.d.ts"
42
- ],
43
- "internals": [
44
- "./dist/esm/internals/index.d.ts"
45
- ],
46
- "server": [
47
- "./dist/esm/server.d.ts"
48
- ],
49
- "s3/server": [
50
- "./dist/esm/providers/s3/server.d.ts"
51
- ]
52
- }
53
- },
54
- "repository": {
55
- "type": "git",
56
- "url": "https://github.com/aws-amplify/amplify-js.git"
57
- },
58
- "author": "Amazon Web Services",
59
- "license": "Apache-2.0",
60
- "bugs": {
61
- "url": "https://github.com/aws/aws-amplify/issues"
62
- },
63
- "homepage": "https://aws-amplify.github.io/",
64
- "files": [
65
- "dist/cjs",
66
- "dist/esm",
67
- "internals",
68
- "src",
69
- "server",
70
- "s3"
71
- ],
72
- "dependencies": {
73
- "@aws-sdk/types": "3.398.0",
74
- "@smithy/md5-js": "2.0.7",
75
- "buffer": "4.9.2",
76
- "crc-32": "1.2.2",
77
- "fast-xml-parser": "^4.4.1",
78
- "tslib": "^2.5.0"
79
- },
80
- "exports": {
81
- ".": {
82
- "react-native": "./dist/cjs/index.js",
83
- "types": "./dist/esm/index.d.ts",
84
- "import": "./dist/esm/index.mjs",
85
- "require": "./dist/cjs/index.js"
86
- },
87
- "./internals": {
88
- "types": "./dist/esm/internals/index.d.ts",
89
- "import": "./dist/esm/internals/index.mjs",
90
- "require": "./dist/cjs/internals/index.js"
91
- },
92
- "./server": {
93
- "types": "./dist/esm/server.d.ts",
94
- "import": "./dist/esm/server.mjs",
95
- "require": "./dist/cjs/server.js"
96
- },
97
- "./s3": {
98
- "react-native": "./dist/cjs/providers/s3/index.js",
99
- "types": "./dist/esm/providers/s3/index.d.ts",
100
- "import": "./dist/esm/providers/s3/index.mjs",
101
- "require": "./dist/cjs/providers/s3/index.js"
102
- },
103
- "./s3/server": {
104
- "types": "./dist/esm/providers/s3/server.d.ts",
105
- "import": "./dist/esm/providers/s3/server.mjs",
106
- "require": "./dist/cjs/providers/s3/server.js"
107
- },
108
- "./package.json": "./package.json"
109
- },
110
- "peerDependencies": {
111
- "@aws-amplify/core": "^6.1.0"
112
- },
113
- "devDependencies": {
114
- "@aws-amplify/core": "6.14.0",
115
- "@aws-amplify/react-native": "1.3.0",
116
- "@types/node": "20.14.12"
117
- },
118
- "gitHead": "bcb7c416052db16e7e329b2ac44fadc564274e2b"
2
+ "name": "@aws-amplify/storage",
3
+ "version": "6.10.2-unstable.1fe3c5d.0+1fe3c5d",
4
+ "description": "Storage category of aws-amplify",
5
+ "main": "./dist/cjs/index.js",
6
+ "module": "./dist/esm/index.mjs",
7
+ "react-native": {
8
+ "./dist/cjs/index": "./src/index.ts",
9
+ "fast-xml-parser": "fast-xml-parser",
10
+ "buffer": "buffer"
11
+ },
12
+ "typings": "./dist/esm/index.d.ts",
13
+ "browser": {
14
+ "./dist/esm/providers/s3/utils/client/runtime/base64/index.native.mjs": "./dist/esm/providers/s3/utils/client/runtime/base64/index.browser.mjs",
15
+ "./dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/fetch.mjs": "./dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.mjs",
16
+ "./dist/esm/providers/s3/utils/client/runtime/xmlParser/pureJs.mjs": "./dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs",
17
+ "fast-xml-parser": false,
18
+ "buffer": false
19
+ },
20
+ "sideEffects": false,
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "scripts": {
25
+ "test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
26
+ "build-with-test": "npm test && npm run build",
27
+ "build:umd": "webpack && webpack --config ./webpack.config.dev.js",
28
+ "build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
29
+ "build:watch": "npm run build:esm-cjs -- --watch",
30
+ "build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
31
+ "clean": "npm run clean:size && rimraf lib-esm lib dist",
32
+ "clean:size": "rimraf dual-publish-tmp tmp*",
33
+ "format": "echo \"Not implemented\"",
34
+ "lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
35
+ "lint:fix": "eslint '**/*.{ts,tsx}' --fix",
36
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 90.31"
37
+ },
38
+ "typesVersions": {
39
+ ">=4.2": {
40
+ "s3": [
41
+ "./dist/esm/providers/s3/index.d.ts"
42
+ ],
43
+ "internals": [
44
+ "./dist/esm/internals/index.d.ts"
45
+ ],
46
+ "server": [
47
+ "./dist/esm/server.d.ts"
48
+ ],
49
+ "s3/server": [
50
+ "./dist/esm/providers/s3/server.d.ts"
51
+ ]
52
+ }
53
+ },
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "https://github.com/aws-amplify/amplify-js.git"
57
+ },
58
+ "author": "Amazon Web Services",
59
+ "license": "Apache-2.0",
60
+ "bugs": {
61
+ "url": "https://github.com/aws/aws-amplify/issues"
62
+ },
63
+ "homepage": "https://aws-amplify.github.io/",
64
+ "files": [
65
+ "dist/cjs",
66
+ "dist/esm",
67
+ "internals",
68
+ "src",
69
+ "server",
70
+ "s3"
71
+ ],
72
+ "dependencies": {
73
+ "@aws-sdk/types": "3.398.0",
74
+ "@smithy/md5-js": "2.0.7",
75
+ "buffer": "4.9.2",
76
+ "crc-32": "1.2.2",
77
+ "fast-xml-parser": "^4.4.1",
78
+ "tslib": "^2.5.0"
79
+ },
80
+ "exports": {
81
+ ".": {
82
+ "react-native": "./dist/cjs/index.js",
83
+ "types": "./dist/esm/index.d.ts",
84
+ "import": "./dist/esm/index.mjs",
85
+ "require": "./dist/cjs/index.js"
86
+ },
87
+ "./internals": {
88
+ "types": "./dist/esm/internals/index.d.ts",
89
+ "import": "./dist/esm/internals/index.mjs",
90
+ "require": "./dist/cjs/internals/index.js"
91
+ },
92
+ "./server": {
93
+ "types": "./dist/esm/server.d.ts",
94
+ "import": "./dist/esm/server.mjs",
95
+ "require": "./dist/cjs/server.js"
96
+ },
97
+ "./s3": {
98
+ "react-native": "./dist/cjs/providers/s3/index.js",
99
+ "types": "./dist/esm/providers/s3/index.d.ts",
100
+ "import": "./dist/esm/providers/s3/index.mjs",
101
+ "require": "./dist/cjs/providers/s3/index.js"
102
+ },
103
+ "./s3/server": {
104
+ "types": "./dist/esm/providers/s3/server.d.ts",
105
+ "import": "./dist/esm/providers/s3/server.mjs",
106
+ "require": "./dist/cjs/providers/s3/server.js"
107
+ },
108
+ "./package.json": "./package.json"
109
+ },
110
+ "peerDependencies": {
111
+ "@aws-amplify/core": "6.14.1-unstable.1fe3c5d.0+1fe3c5d"
112
+ },
113
+ "devDependencies": {
114
+ "@aws-amplify/core": "6.14.1-unstable.1fe3c5d.0+1fe3c5d",
115
+ "@aws-amplify/react-native": "1.3.1-unstable.1fe3c5d.0+1fe3c5d",
116
+ "@types/node": "20.14.12"
117
+ },
118
+ "gitHead": "1fe3c5dbea26a7394c43a97af05e3fa8cec95a92"
119
119
  }
@@ -2,11 +2,11 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import {
5
- EMPTY_SHA256_HASH,
6
5
  Endpoint,
7
6
  HttpRequest,
8
7
  HttpResponse,
9
8
  PresignUrlOptions,
9
+ UNSIGNED_PAYLOAD,
10
10
  UserAgentOptions,
11
11
  parseMetadata,
12
12
  presignUrl,
@@ -18,7 +18,6 @@ import {
18
18
  } from '@aws-amplify/core/internals/utils';
19
19
 
20
20
  import {
21
- CONTENT_SHA256_HEADER,
22
21
  assignStringVariables,
23
22
  buildStorageServiceError,
24
23
  deserializeBoolean,
@@ -172,10 +171,6 @@ export const getPresignedGetObjectUrl = async (
172
171
  const endpoint = defaultConfig.endpointResolver(config, input);
173
172
  const { url, headers, method } = await getObjectSerializer(input, endpoint);
174
173
 
175
- // TODO: set content sha256 query parameter with value of UNSIGNED-PAYLOAD instead of empty hash.
176
- // It requires changes in presignUrl. Without this change, the generated url still works,
177
- // but not the same as other tools like AWS SDK and CLI.
178
- url.searchParams.append(CONTENT_SHA256_HEADER, EMPTY_SHA256_HASH);
179
174
  if (config.userAgentValue) {
180
175
  url.searchParams.append(
181
176
  config.userAgentHeader ?? USER_AGENT_HEADER,
@@ -199,7 +194,7 @@ export const getPresignedGetObjectUrl = async (
199
194
  }
200
195
 
201
196
  return presignUrl(
202
- { method, url, body: undefined },
197
+ { method, url, body: UNSIGNED_PAYLOAD },
203
198
  {
204
199
  signingService: defaultConfig.service,
205
200
  signingRegion: config.region,