@ai-ecoverse/slicc-shared-web 1.7.0 → 1.7.1

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/harness/cdn.mjs +4 -2
  2. package/package.json +1 -1
package/harness/cdn.mjs CHANGED
@@ -24,7 +24,7 @@ export async function fetched(url, { attempts = 3, ms = DOWNLOAD_TIMEOUT, fetche
24
24
  export async function download(url) {
25
25
  const { host, pathname, search } = new URL(url);
26
26
  const query = search ? encodeURIComponent(search) : '';
27
- const file = new URL(`./${host}${pathname}${query}`, store);
27
+ const file = new URL(`./${host}${pathname}${query}`.replaceAll('%', '%25'), store);
28
28
  const hit = await readFile(file).catch(ignore);
29
29
  if (hit) return hit;
30
30
  const body = await fetched(url);
@@ -49,7 +49,9 @@ export async function cdn(cdp, remotes) {
49
49
  const failure = { requestId, responseCode: state.status, responseHeaders: cors };
50
50
  return cdp.send('Fetch.fulfillRequest', failure);
51
51
  }
52
- const body = await download(request.url).catch(ignore);
52
+ const body = await download(request.url).catch((error) => {
53
+ console.warn(`harness: could not serve ${request.url}: ${error.message}`);
54
+ });
53
55
  if (!body) return cdp.send('Fetch.failRequest', { requestId, errorReason: 'Failed' });
54
56
  const sent = Buffer.from(body);
55
57
  if (state.corrupt) sent[sent.length - 1] ^= 0xff;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-shared-web",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Shared Renovate, Biome, TypeScript, lefthook and GitHub Actions configuration, plus the CDP integration-test harness, for SLICC's web repos",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",