create-website-build-kit 0.1.13 → 0.1.14
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-website-build-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Scaffold a production marketing site \u2014 Astro on Cloudflare Workers, with the gates, the migration playbook and the accessibility work already wired.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -158,13 +158,17 @@ const notes = [];
|
|
|
158
158
|
*/
|
|
159
159
|
const refusals = new Set();
|
|
160
160
|
|
|
161
|
-
function refuse(reason, url) {
|
|
161
|
+
function refuse(reason, url, kind) {
|
|
162
162
|
if (!refusals.has(reason)) {
|
|
163
163
|
refusals.add(reason);
|
|
164
164
|
console.log(` ${YELLOW}refused${RESET} ${reason}`);
|
|
165
|
+
/* ⚠ ONLY A HOST REFUSAL IS SOMETHING --allow-internal CAN EXCUSE. Offering
|
|
166
|
+
the flag for a `file:` redirect is a dead hint — the same mistake this
|
|
167
|
+
script already fixed once in the startup message, still living here. */
|
|
165
168
|
notes.push(
|
|
166
169
|
`Refused to fetch ${url} — ${reason}. This was NOT a network error: the crawl skipped it ` +
|
|
167
|
-
`deliberately, so the inventory is incomplete
|
|
170
|
+
`deliberately, so the inventory is incomplete.` +
|
|
171
|
+
(kind === 'host' ? ' Re-run with --allow-internal if that host is yours.' : ''),
|
|
168
172
|
);
|
|
169
173
|
}
|
|
170
174
|
return null;
|
|
@@ -172,7 +176,7 @@ function refuse(reason, url) {
|
|
|
172
176
|
|
|
173
177
|
async function req(url, options = {}) {
|
|
174
178
|
const refusal = blockedReason(url, { allowInternal });
|
|
175
|
-
if (refusal) return refuse(refusal.reason, url);
|
|
179
|
+
if (refusal) return refuse(refusal.reason, url, refusal.kind);
|
|
176
180
|
|
|
177
181
|
const controller = new AbortController();
|
|
178
182
|
const timer = setTimeout(() => controller.abort(), 20000);
|
|
@@ -193,7 +197,7 @@ async function req(url, options = {}) {
|
|
|
193
197
|
for (let hops = 0; follow && res.status >= 300 && res.status < 400 && res.headers.get('location') && hops < MAX_HOPS; hops++) {
|
|
194
198
|
const next = new URL(res.headers.get('location'), url).toString();
|
|
195
199
|
const hopRefusal = blockedReason(next, { allowInternal });
|
|
196
|
-
if (hopRefusal) return refuse(`${hopRefusal.reason} — reached by a redirect from ${url}`, next);
|
|
200
|
+
if (hopRefusal) return refuse(`${hopRefusal.reason} — reached by a redirect from ${url}`, next, hopRefusal.kind);
|
|
197
201
|
url = next;
|
|
198
202
|
res = await fetch(url, { ...options, redirect: 'manual', signal: controller.signal });
|
|
199
203
|
}
|