@volter/world-core 3.0.8 → 3.0.9
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.
|
@@ -979,9 +979,16 @@
|
|
|
979
979
|
},
|
|
980
980
|
{
|
|
981
981
|
"host": "github.com",
|
|
982
|
-
"pathPattern": "^/login|^/session|^/settings/|^/organizations/|^/apps/|^/[^/]+/[^/]+\\.git/"
|
|
982
|
+
"pathPattern": "^/login|^/session|^/settings/|^/organizations/|^/apps/|^/[^/]+/[^/]+\\.git/|^/[^/]+/[^/]+/settings/pages"
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
"suffix": ".github.io"
|
|
983
986
|
}
|
|
984
987
|
],
|
|
988
|
+
"hostsClaimed": {
|
|
989
|
+
"door": "/_twin/hosts",
|
|
990
|
+
"note": "GitHub Pages sites: each owner's github.io and each custom domain, answered with the publishing branch's files."
|
|
991
|
+
},
|
|
985
992
|
"archetype": "crud",
|
|
986
993
|
"protocol": {
|
|
987
994
|
"declared": "3",
|
package/dist/src/pack-fetch.js
CHANGED
|
@@ -331,10 +331,14 @@ export function createPackFetch(parts, options = {}) {
|
|
|
331
331
|
// over R2's /{Bucket}/{Key}), the root workspace at the root alone
|
|
332
332
|
const page = placed && ['document', 'iframe'].includes(request.headers.get('sec-fetch-dest') ?? '');
|
|
333
333
|
const rooted = (x) => x.s.decl.path.replace(/\/+$/, '') === '';
|
|
334
|
+
// a request the World routed from a vendor's own hostname (its proxy, a site, a call inside the World) is answered by
|
|
335
|
+
// that host's screens alone: a page of github.com never answers at <owner>.github.io, nor Cloudflare's sign-in at a
|
|
336
|
+
// Worker's Custom Domain; a screen by its path alone is for the twin reached at its own address
|
|
337
|
+
const addressed = !placed && request.headers.has('x-volter-twin-original-host');
|
|
334
338
|
const byPath = hits.find((x) => x.onHost && exact(x.s))
|
|
335
339
|
?? (page ? hits.find((x) => !rooted(x)) ?? (path === '/' ? hits.find((x) => x.s.decl.kind === 'workspace') : undefined) : undefined)
|
|
336
|
-
?? (apiPath ? undefined : hits.find((x) => x.onHost) ?? hits.find((x) => !rooted(x))
|
|
337
|
-
?? (placed ? hits.find((x) => x.s.decl.kind === 'workspace') : undefined));
|
|
340
|
+
?? (apiPath ? undefined : hits.find((x) => x.onHost) ?? (addressed ? undefined : hits.find((x) => !rooted(x))
|
|
341
|
+
?? (placed ? hits.find((x) => x.s.decl.kind === 'workspace') : undefined)));
|
|
338
342
|
if (byPath) {
|
|
339
343
|
if (readOnly && request.method !== 'GET' && request.method !== 'HEAD')
|
|
340
344
|
return refusedReadOnly();
|
|
@@ -979,9 +979,16 @@
|
|
|
979
979
|
},
|
|
980
980
|
{
|
|
981
981
|
"host": "github.com",
|
|
982
|
-
"pathPattern": "^/login|^/session|^/settings/|^/organizations/|^/apps/|^/[^/]+/[^/]+\\.git/"
|
|
982
|
+
"pathPattern": "^/login|^/session|^/settings/|^/organizations/|^/apps/|^/[^/]+/[^/]+\\.git/|^/[^/]+/[^/]+/settings/pages"
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
"suffix": ".github.io"
|
|
983
986
|
}
|
|
984
987
|
],
|
|
988
|
+
"hostsClaimed": {
|
|
989
|
+
"door": "/_twin/hosts",
|
|
990
|
+
"note": "GitHub Pages sites: each owner's github.io and each custom domain, answered with the publishing branch's files."
|
|
991
|
+
},
|
|
985
992
|
"archetype": "crud",
|
|
986
993
|
"protocol": {
|
|
987
994
|
"declared": "3",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/world-core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"description": "The kernel of Volter World: one log per twin, branches as pointers, checkpoints, the fold that keeps a twin current, the head that performs a write against the vendor, references, and the git plane. A twin package builds on it; the runtime serves it.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"twin",
|
package/src/pack-fetch.ts
CHANGED
|
@@ -349,10 +349,14 @@ export function createPackFetch(parts: PackParts, options: PackFetchOptions = {}
|
|
|
349
349
|
// over R2's /{Bucket}/{Key}), the root workspace at the root alone
|
|
350
350
|
const page = placed && ['document', 'iframe'].includes(request.headers.get('sec-fetch-dest') ?? '');
|
|
351
351
|
const rooted = (x: (typeof hits)[number]): boolean => x.s.decl.path.replace(/\/+$/, '') === '';
|
|
352
|
+
// a request the World routed from a vendor's own hostname (its proxy, a site, a call inside the World) is answered by
|
|
353
|
+
// that host's screens alone: a page of github.com never answers at <owner>.github.io, nor Cloudflare's sign-in at a
|
|
354
|
+
// Worker's Custom Domain; a screen by its path alone is for the twin reached at its own address
|
|
355
|
+
const addressed = !placed && request.headers.has('x-volter-twin-original-host');
|
|
352
356
|
const byPath = hits.find((x) => x.onHost && exact(x.s))
|
|
353
357
|
?? (page ? hits.find((x) => !rooted(x)) ?? (path === '/' ? hits.find((x) => x.s.decl.kind === 'workspace') : undefined) : undefined)
|
|
354
|
-
?? (apiPath ? undefined : hits.find((x) => x.onHost) ?? hits.find((x) => !rooted(x))
|
|
355
|
-
?? (placed ? hits.find((x) => x.s.decl.kind === 'workspace') : undefined));
|
|
358
|
+
?? (apiPath ? undefined : hits.find((x) => x.onHost) ?? (addressed ? undefined : hits.find((x) => !rooted(x))
|
|
359
|
+
?? (placed ? hits.find((x) => x.s.decl.kind === 'workspace') : undefined)));
|
|
356
360
|
if (byPath) {
|
|
357
361
|
if (readOnly && request.method !== 'GET' && request.method !== 'HEAD') return refusedReadOnly();
|
|
358
362
|
return byPath.s.answer(await open(request, byPath.s.decl.id, request.method, byPath.s.decl.path, { ...(byPath.onHost?.params ?? {}), ...byPath.hit!.params }));
|