@abtnode/util 1.16.39 → 1.16.40-beta-20250227-092112-1815be0a

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 +15 -6
  2. package/package.json +10 -10
package/lib/security.js CHANGED
@@ -222,13 +222,16 @@ async function patchResponseHeader(rawConfig, { node, blocklet }) {
222
222
  config.contentSecurityPolicy.directives['connect-src'] = patchValueIntoDirectives(
223
223
  config.contentSecurityPolicy.directives,
224
224
  'connect-src',
225
- // 默认只需要写 http,会同时放行 https;反之不成立
226
- domainAliases.filter((x) => x).map((x) => `http://${x}/.well-known/ping`),
225
+ [
226
+ "'self'",
227
+ // 默认只需要写 http,会同时放行 https;反之不成立
228
+ ...domainAliases.filter((x) => x).map((x) => `http://${x}/.well-known/ping`),
227
229
 
228
- // 以下三个域名都是 iconify 的服务
229
- 'https://api.simplesvg.com',
230
- 'https://api.iconify.design',
231
- 'https://api.unisvg.com'
230
+ // 以下三个域名都是 iconify 的服务
231
+ 'https://api.simplesvg.com',
232
+ 'https://api.iconify.design',
233
+ 'https://api.unisvg.com',
234
+ ]
232
235
  );
233
236
 
234
237
  config.contentSecurityPolicy.directives['script-src'] = patchValueIntoDirectives(
@@ -250,6 +253,12 @@ async function patchResponseHeader(rawConfig, { node, blocklet }) {
250
253
  ]
251
254
  );
252
255
 
256
+ config.contentSecurityPolicy.directives['frame-ancestors'] = patchValueIntoDirectives(
257
+ config.contentSecurityPolicy.directives,
258
+ 'frame-ancestors',
259
+ ["'self'", ...(blocklet.settings.userSpaceHosts || []).map((x) => `https://${x}`)]
260
+ );
261
+
253
262
  return config;
254
263
  }
255
264
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.39",
6
+ "version": "1.16.40-beta-20250227-092112-1815be0a",
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.16.39",
22
- "@arcblock/did": "^1.19.10",
21
+ "@abtnode/constant": "1.16.40-beta-20250227-092112-1815be0a",
22
+ "@arcblock/did": "^1.19.12",
23
23
  "@arcblock/pm2": "^5.4.0",
24
- "@blocklet/constant": "1.16.39",
25
- "@blocklet/meta": "1.16.39",
26
- "@ocap/client": "1.19.10",
27
- "@ocap/mcrypto": "1.19.10",
28
- "@ocap/util": "1.19.10",
29
- "@ocap/wallet": "1.19.10",
24
+ "@blocklet/constant": "1.16.40-beta-20250227-092112-1815be0a",
25
+ "@blocklet/meta": "1.16.40-beta-20250227-092112-1815be0a",
26
+ "@ocap/client": "1.19.12",
27
+ "@ocap/mcrypto": "1.19.12",
28
+ "@ocap/util": "1.19.12",
29
+ "@ocap/wallet": "1.19.12",
30
30
  "archiver": "^7.0.1",
31
31
  "axios": "^1.7.9",
32
32
  "axios-mock-adapter": "^2.1.0",
@@ -82,5 +82,5 @@
82
82
  "fs-extra": "^11.2.0",
83
83
  "jest": "^29.7.0"
84
84
  },
85
- "gitHead": "e3a614757b32dba71dcc187f20060932df31eab6"
85
+ "gitHead": "e33d791e24236a10ed3d196618aba989a0eee8ad"
86
86
  }