@abtnode/util 1.16.53-beta-20251011-095147-8bd212c5 → 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.
- package/lib/security.js +6 -6
- 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
|
|
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
|
-
|
|
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,6 +311,7 @@ async function patchResponseHeader(rawConfig, { node, blocklet, trustedDomains =
|
|
|
312
311
|
"'self'",
|
|
313
312
|
// stripe 服务
|
|
314
313
|
'https://js.stripe.com',
|
|
314
|
+
...trustedDomains.filter(Boolean).map((x) => `https://${x}`),
|
|
315
315
|
]
|
|
316
316
|
);
|
|
317
317
|
|
|
@@ -321,7 +321,7 @@ async function patchResponseHeader(rawConfig, { node, blocklet, trustedDomains =
|
|
|
321
321
|
[
|
|
322
322
|
"'self'",
|
|
323
323
|
...(blocklet.settings.userSpaceHosts || []).map((x) => `https://${x}`),
|
|
324
|
-
...trustedDomains.filter(Boolean).map((x) => `
|
|
324
|
+
...trustedDomains.filter(Boolean).map((x) => `https://${x}`),
|
|
325
325
|
]
|
|
326
326
|
);
|
|
327
327
|
|
|
@@ -337,7 +337,7 @@ async function patchCors(rawConfig, { node, blocklet }) {
|
|
|
337
337
|
const nodeInfo = await node.getNodeInfo({ useCache: true });
|
|
338
338
|
let domainAliases = await node.getBlockletDomainAliases({ blocklet, nodeInfo });
|
|
339
339
|
domainAliases = (domainAliases || []).map((x) => x.value);
|
|
340
|
-
result.push(...domainAliases.map((x) => withHttps(x))
|
|
340
|
+
result.push(...domainAliases.map((x) => withHttps(x)));
|
|
341
341
|
// 获取所有统一登录站点群的所有域名别名
|
|
342
342
|
const federated = blocklet.settings.federated || {};
|
|
343
343
|
const sites = (federated?.sites || []).filter((x) => x?.isMaster !== false || x.status === 'approved');
|
|
@@ -346,7 +346,7 @@ async function patchCors(rawConfig, { node, blocklet }) {
|
|
|
346
346
|
siteAlias.push(new URL(site.appUrl).hostname);
|
|
347
347
|
siteAlias.push(...(site.aliasDomain || []));
|
|
348
348
|
}
|
|
349
|
-
result.push(...siteAlias.map((x) => withHttps(x))
|
|
349
|
+
result.push(...siteAlias.map((x) => withHttps(x)));
|
|
350
350
|
config.origin.value = [...new Set(result)];
|
|
351
351
|
}
|
|
352
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-
|
|
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-
|
|
22
|
-
"@abtnode/db-cache": "1.16.53-beta-
|
|
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-
|
|
26
|
+
"@blocklet/constant": "1.16.53-beta-20251013-075536-64fcb94b",
|
|
27
27
|
"@blocklet/error": "^0.2.5",
|
|
28
|
-
"@blocklet/meta": "1.16.53-beta-
|
|
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": "
|
|
94
|
+
"gitHead": "0c9fd57c3ffd075ed9f0ed365f76167f91f11f5a"
|
|
95
95
|
}
|