picgo-plugin-s3 1.4.0-beta.3 → 1.4.1

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/uploader.js +11 -7
  2. package/package.json +6 -6
package/dist/uploader.js CHANGED
@@ -7,12 +7,14 @@ const utils_1 = require("./utils");
7
7
  function createS3Client(opts) {
8
8
  var _a;
9
9
  let sslEnabled = true;
10
- try {
11
- const u = new URL(opts.endpoint || '');
12
- sslEnabled = u.protocol === 'https:';
13
- }
14
- catch (err) {
15
- console.warn('Failed to parse endpoint URL, defaulting to HTTPS:', err);
10
+ if (opts.endpoint) {
11
+ try {
12
+ const u = new URL(opts.endpoint || '');
13
+ sslEnabled = u.protocol === 'https:';
14
+ }
15
+ catch (err) {
16
+ console.log('Failed to parse endpoint URL, defaulting to HTTPS:', err.message);
17
+ }
16
18
  }
17
19
  const httpHandlerOpts = {};
18
20
  if (sslEnabled) {
@@ -23,7 +25,7 @@ function createS3Client(opts) {
23
25
  }
24
26
  const clientOptions = {
25
27
  region: opts.region || 'auto',
26
- endpoint: opts.endpoint,
28
+ endpoint: opts.endpoint || undefined,
27
29
  credentials: {
28
30
  accessKeyId: opts.accessKeyID,
29
31
  secretAccessKey: opts.secretAccessKey,
@@ -31,6 +33,8 @@ function createS3Client(opts) {
31
33
  tls: sslEnabled,
32
34
  forcePathStyle: (_a = opts.pathStyleAccess) !== null && _a !== void 0 ? _a : false,
33
35
  requestHandler: new node_http_handler_1.NodeHttpHandler(httpHandlerOpts),
36
+ requestChecksumCalculation: "WHEN_REQUIRED",
37
+ responseChecksumValidation: "WHEN_REQUIRED",
34
38
  };
35
39
  return new client_s3_1.S3Client(clientOptions);
36
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picgo-plugin-s3",
3
- "version": "1.4.0-beta.3",
3
+ "version": "1.4.1",
4
4
  "description": "picgo amazon s3 uploader",
5
5
  "main": "dist/index.js",
6
6
  "publishConfig": {
@@ -41,12 +41,12 @@
41
41
  "typescript": "^5.7.2"
42
42
  },
43
43
  "dependencies": {
44
- "@aws-sdk/client-s3": "^3.705.0",
45
- "@aws-sdk/lib-storage": "^3.705.0",
46
- "@aws-sdk/s3-request-presigner": "^3.705.0",
47
- "@smithy/node-http-handler": "^3.3.1",
44
+ "@aws-sdk/client-s3": "~3.729.0",
45
+ "@aws-sdk/lib-storage": "~3.729.0",
46
+ "@aws-sdk/s3-request-presigner": "~3.729.0",
47
+ "@smithy/node-http-handler": "~3.3.1",
48
48
  "file-type": ">16.5.0 <17.0.0",
49
- "hpagent": "^1.2.0",
49
+ "hpagent": "~1.2.0",
50
50
  "mime": ">=3.0.0 <4.0.0",
51
51
  "picgo": "^1.5.8"
52
52
  },