@ai-ecoverse/slicc-shared-web 1.30.11 → 1.30.12
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/harness/cdn.mjs +6 -0
- package/package.json +1 -1
package/harness/cdn.mjs
CHANGED
|
@@ -96,9 +96,15 @@ export async function cdn(cdp, remotes) {
|
|
|
96
96
|
const failure = { requestId, responseCode: state.status, responseHeaders: cors };
|
|
97
97
|
return cdp.send('Fetch.fulfillRequest', failure);
|
|
98
98
|
}
|
|
99
|
+
let refused = 0;
|
|
99
100
|
const body = await download(request.url).catch((error) => {
|
|
101
|
+
refused = Number(/^(4\d\d) /.exec(error.message)?.[1] ?? 0);
|
|
100
102
|
console.warn(`harness: could not serve ${request.url}: ${error.message}`);
|
|
101
103
|
});
|
|
104
|
+
if (refused) {
|
|
105
|
+
const answer = { requestId, responseCode: refused, responseHeaders: cors };
|
|
106
|
+
return cdp.send('Fetch.fulfillRequest', answer);
|
|
107
|
+
}
|
|
102
108
|
if (!body) return cdp.send('Fetch.failRequest', { requestId, errorReason: 'Failed' });
|
|
103
109
|
const sent = Buffer.from(body);
|
|
104
110
|
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.30.
|
|
3
|
+
"version": "1.30.12",
|
|
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",
|