@abtnode/util 1.17.6-beta-20251217-144034-62fafb94 → 1.17.6-beta-20251218-120326-5b44dadf
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 +4 -4
- package/package.json +7 -7
package/lib/security.js
CHANGED
|
@@ -266,7 +266,7 @@ function patchValueIntoDirectives(directives, key, value) {
|
|
|
266
266
|
return [...new Set(currentValue)];
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
async function patchResponseHeader(rawConfig, { node, blocklet, trustedDomains = [] }) {
|
|
269
|
+
async function patchResponseHeader(rawConfig, { node, blocklet, trustedDomains = [], info }) {
|
|
270
270
|
if (!rawConfig?.contentSecurityPolicy?.directives) {
|
|
271
271
|
return rawConfig;
|
|
272
272
|
}
|
|
@@ -295,7 +295,7 @@ async function patchResponseHeader(rawConfig, { node, blocklet, trustedDomains =
|
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
const nodeInfo = await node.getNodeInfo({ useCache: true });
|
|
298
|
+
const nodeInfo = info || (await node.getNodeInfo({ useCache: true }));
|
|
299
299
|
// 添加 domain 的别名,需要放行 .well-known/ping 接口
|
|
300
300
|
let domainAliases = await node.getBlockletDomainAliases({ blocklet, nodeInfo });
|
|
301
301
|
domainAliases = (domainAliases || []).map((x) => x.value);
|
|
@@ -347,13 +347,13 @@ async function patchResponseHeader(rawConfig, { node, blocklet, trustedDomains =
|
|
|
347
347
|
return config;
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
async function patchCors(rawConfig, { node, blocklet }) {
|
|
350
|
+
async function patchCors(rawConfig, { node, blocklet, info }) {
|
|
351
351
|
const config = cloneDeep(rawConfig);
|
|
352
352
|
if (config?.origin?.smart) {
|
|
353
353
|
// 获取当前应用自身的所有域名别名
|
|
354
354
|
const result = [];
|
|
355
355
|
result.push(...(config.origin?.value || []));
|
|
356
|
-
const nodeInfo = await node.getNodeInfo({ useCache: true });
|
|
356
|
+
const nodeInfo = info || (await node.getNodeInfo({ useCache: true }));
|
|
357
357
|
let domainAliases = await node.getBlockletDomainAliases({ blocklet, nodeInfo });
|
|
358
358
|
domainAliases = (domainAliases || []).map((x) => x.value);
|
|
359
359
|
result.push(...domainAliases.map((x) => withHttps(x)));
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.17.6-beta-
|
|
6
|
+
"version": "1.17.6-beta-20251218-120326-5b44dadf",
|
|
7
7
|
"description": "ArcBlock's JavaScript utility",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
"author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@abtnode/constant": "1.17.6-beta-
|
|
22
|
-
"@abtnode/db-cache": "1.17.6-beta-
|
|
21
|
+
"@abtnode/constant": "1.17.6-beta-20251218-120326-5b44dadf",
|
|
22
|
+
"@abtnode/db-cache": "1.17.6-beta-20251218-120326-5b44dadf",
|
|
23
23
|
"@arcblock/did": "^1.27.15",
|
|
24
24
|
"@arcblock/event-hub": "^1.27.15",
|
|
25
25
|
"@arcblock/pm2": "^6.0.12",
|
|
26
|
-
"@blocklet/constant": "1.17.6-beta-
|
|
26
|
+
"@blocklet/constant": "1.17.6-beta-20251218-120326-5b44dadf",
|
|
27
27
|
"@blocklet/error": "^0.3.5",
|
|
28
|
-
"@blocklet/meta": "1.17.6-beta-
|
|
29
|
-
"@blocklet/xss": "^0.3.
|
|
28
|
+
"@blocklet/meta": "1.17.6-beta-20251218-120326-5b44dadf",
|
|
29
|
+
"@blocklet/xss": "^0.3.14",
|
|
30
30
|
"@ocap/client": "^1.27.15",
|
|
31
31
|
"@ocap/mcrypto": "^1.27.15",
|
|
32
32
|
"@ocap/util": "^1.27.15",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"express": "^4.18.2",
|
|
91
91
|
"fs-extra": "^11.2.0"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "a07b4f70aa6dddea49ed794423b47d36dc206e53"
|
|
94
94
|
}
|