@easy-cms/storage-s3 1.4.1 → 1.4.2

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -57,13 +57,18 @@ function s3Storage(options) {
57
57
  if (!response.ok) throw await s3Error("PUT", key, response);
58
58
  },
59
59
  // Large files from the browser: a presigned PUT (the bucket needs CORS for the admin's
60
- // origin). The size is checked once the file is there.
60
+ // origin). The size and contents are checked once the file is there.
61
61
  async uploadURL(key, { contentType, expiresIn }) {
62
62
  if (!client) throw new Error("s3Storage used before init()");
63
63
  const url = new URL(objectURL(prefix + key));
64
64
  url.searchParams.set("X-Amz-Expires", String(expiresIn));
65
- const signed = await client.sign(url.toString(), { method: "PUT", aws: { signQuery: true } });
66
- return { url: signed.url, method: "PUT", headers: { "content-type": contentType } };
65
+ const headers = { "content-type": contentType };
66
+ const signed = await client.sign(url.toString(), {
67
+ method: "PUT",
68
+ headers,
69
+ aws: { signQuery: true, allHeaders: true }
70
+ });
71
+ return { url: signed.url, method: "PUT", headers };
67
72
  },
68
73
  async getStart(key, bytes) {
69
74
  const response = await request(key, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/storage-s3",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "S3-compatible upload storage for Easy CMS: AWS S3, Cloudflare R2, MinIO",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,12 +19,12 @@
19
19
  "aws4fetch": "^1.0.20"
20
20
  },
21
21
  "peerDependencies": {
22
- "@easy-cms/core": "^1.4.1"
22
+ "@easy-cms/core": "^1.4.2"
23
23
  },
24
24
  "devDependencies": {
25
25
  "sharp": "^0.35.5",
26
- "@easy-cms/core": "^1.4.1",
27
- "@easy-cms/db-sqlite": "^1.4.1"
26
+ "@easy-cms/core": "^1.4.2",
27
+ "@easy-cms/db-sqlite": "^1.4.2"
28
28
  },
29
29
  "engines": {
30
30
  "node": ">=22.12"