dsh-unlag 1.9.42 → 1.9.44

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/index.js +10 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1496,9 +1496,18 @@ export async function verifyStartupRows(graph, fetchBody, rows, budgetMs = MAX_V
1496
1496
  const wanted = []
1497
1497
  for (const row of offered) {
1498
1498
  if (typeof row !== 'string' || row === '') continue
1499
- if (row.length > MAX_STARTUP_ROW_CHARS) continue
1499
+ // A row past the bound is a script that will not be read, and a script this check does not read
1500
+ // is one nothing proved the next document could load: refuse the list instead of approving the
1501
+ // part that happened to be readable.
1502
+ if (row.length > MAX_STARTUP_ROW_CHARS) {
1503
+ return { status: 'blocked', reason: 'list', detail: 'the startup list names an address longer than a document loads' }
1504
+ }
1500
1505
  const path = row.includes('://') ? row.replace(/^[a-z]+:\/\/[^/]+/iu, '') : row
1501
1506
  const url = path.startsWith('/') ? path : `/${path.replace(/^\.?\//u, '')}`
1507
+ // A list can name the same address more than once, and one address can be most of a profile's
1508
+ // bytes: read each address once so a repeated row cannot make one check read the profile's
1509
+ // scripts tens of times.
1510
+ if (wanted.some((entry) => entry.url === url)) continue
1502
1511
  const request = bundleRequest(url)
1503
1512
  wanted.push({ url, ids: request === null ? [] : request.ids })
1504
1513
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-unlag",
3
- "version": "1.9.42",
3
+ "version": "1.9.44",
4
4
  "type": "module",
5
5
  "description": "A press applies plugin edits right away and brings a laggy interface back; automatic reloading stays off unless you turn it on, so the press is the only trigger, and nothing restarts.",
6
6
  "license": "MIT",