@abtnode/util 1.16.53-beta-20251013-005429-ca3b05de → 1.16.53-beta-20251013-075536-64fcb94b

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/lib/security.js +6 -7
  2. package/package.json +6 -6
package/lib/security.js CHANGED
@@ -7,7 +7,7 @@ const { dirname, join, sep } = require('path');
7
7
  const resolve = require('resolve/sync');
8
8
  const { tmpdir, homedir } = require('os');
9
9
  const which = require('which');
10
- const { withHttps, withHttp } = require('ufo');
10
+ const { withHttps } = require('ufo');
11
11
  const { exec } = require('child_process');
12
12
  const { promisify } = require('util');
13
13
 
@@ -286,8 +286,7 @@ async function patchResponseHeader(rawConfig, { node, blocklet, trustedDomains =
286
286
  'connect-src',
287
287
  [
288
288
  "'self'",
289
- // 默认只需要写 http,会同时放行 https;反之不成立
290
- ...domainAliases.filter((x) => x).map((x) => `http://${x}/.well-known/ping`),
289
+ ...domainAliases.filter((x) => x).map((x) => `https://${x}/.well-known/ping`),
291
290
 
292
291
  // 以下三个域名都是 iconify 的服务
293
292
  'https://api.simplesvg.com',
@@ -312,7 +311,7 @@ async function patchResponseHeader(rawConfig, { node, blocklet, trustedDomains =
312
311
  "'self'",
313
312
  // stripe 服务
314
313
  'https://js.stripe.com',
315
- ...trustedDomains.filter(Boolean).map((x) => `http://${x}`),
314
+ ...trustedDomains.filter(Boolean).map((x) => `https://${x}`),
316
315
  ]
317
316
  );
318
317
 
@@ -322,7 +321,7 @@ async function patchResponseHeader(rawConfig, { node, blocklet, trustedDomains =
322
321
  [
323
322
  "'self'",
324
323
  ...(blocklet.settings.userSpaceHosts || []).map((x) => `https://${x}`),
325
- ...trustedDomains.filter(Boolean).map((x) => `http://${x}`),
324
+ ...trustedDomains.filter(Boolean).map((x) => `https://${x}`),
326
325
  ]
327
326
  );
328
327
 
@@ -338,7 +337,7 @@ async function patchCors(rawConfig, { node, blocklet }) {
338
337
  const nodeInfo = await node.getNodeInfo({ useCache: true });
339
338
  let domainAliases = await node.getBlockletDomainAliases({ blocklet, nodeInfo });
340
339
  domainAliases = (domainAliases || []).map((x) => x.value);
341
- result.push(...domainAliases.map((x) => withHttps(x)), ...domainAliases.map((x) => withHttp(x)));
340
+ result.push(...domainAliases.map((x) => withHttps(x)));
342
341
  // 获取所有统一登录站点群的所有域名别名
343
342
  const federated = blocklet.settings.federated || {};
344
343
  const sites = (federated?.sites || []).filter((x) => x?.isMaster !== false || x.status === 'approved');
@@ -347,7 +346,7 @@ async function patchCors(rawConfig, { node, blocklet }) {
347
346
  siteAlias.push(new URL(site.appUrl).hostname);
348
347
  siteAlias.push(...(site.aliasDomain || []));
349
348
  }
350
- result.push(...siteAlias.map((x) => withHttps(x)), ...siteAlias.map((x) => withHttp(x)));
349
+ result.push(...siteAlias.map((x) => withHttps(x)));
351
350
  config.origin.value = [...new Set(result)];
352
351
  }
353
352
  return config;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.53-beta-20251013-005429-ca3b05de",
6
+ "version": "1.16.53-beta-20251013-075536-64fcb94b",
7
7
  "description": "ArcBlock's JavaScript utility",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,14 +18,14 @@
18
18
  "author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
19
19
  "license": "Apache-2.0",
20
20
  "dependencies": {
21
- "@abtnode/constant": "1.16.53-beta-20251013-005429-ca3b05de",
22
- "@abtnode/db-cache": "1.16.53-beta-20251013-005429-ca3b05de",
21
+ "@abtnode/constant": "1.16.53-beta-20251013-075536-64fcb94b",
22
+ "@abtnode/db-cache": "1.16.53-beta-20251013-075536-64fcb94b",
23
23
  "@arcblock/did": "1.25.6",
24
24
  "@arcblock/event-hub": "1.25.6",
25
25
  "@arcblock/pm2": "^6.0.12",
26
- "@blocklet/constant": "1.16.53-beta-20251013-005429-ca3b05de",
26
+ "@blocklet/constant": "1.16.53-beta-20251013-075536-64fcb94b",
27
27
  "@blocklet/error": "^0.2.5",
28
- "@blocklet/meta": "1.16.53-beta-20251013-005429-ca3b05de",
28
+ "@blocklet/meta": "1.16.53-beta-20251013-075536-64fcb94b",
29
29
  "@blocklet/xss": "^0.2.9",
30
30
  "@ocap/client": "1.25.6",
31
31
  "@ocap/mcrypto": "1.25.6",
@@ -91,5 +91,5 @@
91
91
  "fs-extra": "^11.2.0",
92
92
  "jest": "^29.7.0"
93
93
  },
94
- "gitHead": "fa6cf9ee72911e51fb53cfbee9dfc0e781c60bd4"
94
+ "gitHead": "0c9fd57c3ffd075ed9f0ed365f76167f91f11f5a"
95
95
  }