@adobe/helix-admin-support 1.3.12 → 1.3.14

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.3.14](https://github.com/adobe/helix-admin-support/compare/v1.3.13...v1.3.14) (2022-10-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @aws-sdk/client-s3 to v3.181.0 ([d4c327e](https://github.com/adobe/helix-admin-support/commit/d4c327ef520b45866f0729ea4b7626660237bcab))
7
+
8
+ ## [1.3.13](https://github.com/adobe/helix-admin-support/compare/v1.3.12...v1.3.13) (2022-09-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fetch S3 regression ([fa2b571](https://github.com/adobe/helix-admin-support/commit/fa2b5715112314224feb520af16f93a51fc0e4bb))
14
+
1
15
  ## [1.3.12](https://github.com/adobe/helix-admin-support/compare/v1.3.11...v1.3.12) (2022-09-27)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-admin-support",
3
- "version": "1.3.12",
3
+ "version": "1.3.14",
4
4
  "description": "Helix Admin Support Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -34,7 +34,7 @@
34
34
  "@adobe/fetch": "3.1.4",
35
35
  "@adobe/helix-shared-config": "9.1.1",
36
36
  "@adobe/helix-shared-utils": "2.1.0",
37
- "@aws-sdk/client-s3": "3.178.0",
37
+ "@aws-sdk/client-s3": "3.181.0",
38
38
  "@aws-sdk/node-http-handler": "3.178.0"
39
39
  },
40
40
  "devDependencies": {
package/src/fetch-s3.js CHANGED
@@ -62,23 +62,21 @@ export async function fetchS3(context, bucketId, key, head = false) {
62
62
  const s3 = new S3Client(opts);
63
63
  const Command = head ? HeadObjectCommand : GetObjectCommand;
64
64
  let res;
65
+ let buffer = '';
65
66
  try {
66
67
  res = await s3.send(new Command({
67
68
  Bucket: bucketId,
68
69
  Key: key,
69
- // todo: add timeout
70
70
  }));
71
+ if (!head) {
72
+ buffer = await new Response(res.Body, {}).buffer();
73
+ if (res.ContentEncoding === 'gzip') {
74
+ buffer = await gunzip(buffer);
75
+ }
76
+ }
71
77
  } finally {
72
78
  s3.destroy();
73
79
  }
74
-
75
- let buffer = '';
76
- if (!head) {
77
- buffer = await new Response(res.Body, {}).buffer();
78
- if (res.ContentEncoding === 'gzip') {
79
- buffer = await gunzip(buffer);
80
- }
81
- }
82
80
  const headers = {};
83
81
  if (res.LastModified) {
84
82
  headers['last-modified'] = res.LastModified.toUTCString();