fix(hosting): 호스팅 검사가 SPA fallback과 SW 스크립트 헤더를 본다 (1101/13-04)
문제
라우터는 browser history를 쓴다. 호스트가 앱 경로에 index.html을 주지
않으면 `/`는 열리고 새로고침·북마크·공유 링크만 404가 된다. 호스팅 계약
(config/hosting/cache-policy.json)에 앱 경로 표면이 없고, live probe는
`/`, config, manifest, entry script만 요청해서 FE-GATE-019가 그대로
PASS한다. 운영 문서가 no-cache로 서빙하라는 service-worker.js도 선언과
검사에 없다. e2e는 fallback을 기본으로 하는 vite preview라 드러나지 않는다.
고른 방법
- cache-policy.json에 표면 두 개를 더한다.
- appRoute: 빌드에 파일이 없는 경로 `/__probe/deep-link`. index와 같은
Cache-Control, content-type, 보안 헤더를 요구한다.
- serviceWorker: `/service-worker.js`, no-cache, JS MIME.
`requiredWhen: "service-worker-shipped"`로 워커를 싣는 빌드
(ACTIVE, REMOVE_REGISTRATION)에서만 요구한다. 이 판정은
checkPublicServiceWorkers와 같은 함수(shipsServiceWorker)를 쓴다.
- live probe를 scripts/lib/hosting-probe.ts의 probeLiveRelease로 옮겨
fetcher를 주입해 단위 테스트한다. 요청 경로는 정책의 path에서 읽는다.
appRoute는 200이어야 하고, 응답이 index.html과 같은 entry script를
가리켜야 한다. 그래서 404와, 200으로 답하는 다른 페이지(soft 404)를
모두 FAIL로 잡는다.
- release-cache-rollback.md에 fallback 규칙과 desktop 서버용 nginx 예시를
적는다. 예시는 손으로 썼고, 빠진 hashed asset은 index.html이 아니라
404여야 한다는 점(구 탭 재적재, FE-RB-002)과 add_header 상속 함정을
적었다.
버린 대안
- createHashRouter로 바꿔 fallback 자체를 없애기: URL과 기존 경로 계약·
테스트가 모두 바뀐다(리뷰 대안 비교에서 기각).
- 정책 이름(serviceWorker)으로 스크립트가 조건을 아는 방식: 정책 파일만
읽는 운영자가 항상 필요한 표면으로 오해한다. 조건을 JSON에 적었다.
- 리다이렉트 뒤 최종 경로까지 비교: 이번 완료 기준(404 FAIL) 밖이라 넣지
않았다.
위험·한계
- nginx 예시는 이 머신에 nginx가 없어 실행하지 않았다. CI도 돌리지 않는다.
호스트가 실제로 무엇을 주는지는 live probe가 확인한다.
- 이미 배포한 호스트에 fallback이나 SW 헤더가 없으면 FE-GATE-019가 새로
실패한다(의도).
- 앱 base path가 `/`가 아닌 배포는 기존 probe와 같이 다루지 않는다.
검증
- RED: node scripts/run-vitest.ts run tests/unit/hosting-probe.test.ts
5 failed. "expected undefined to match object { cacheControl:
'no-cache', …}"(정책에 appRoute·serviceWorker 없음),
"probeLiveRelease is not a function"
- GREEN: 같은 파일 22 passed. fallback 없는 호스트에서
["appRoute http-status", "appRoute entry-script"]가 실패로 나온다
- node scripts/run-vitest.ts run tests/unit/hosting-probe.test.ts
tests/platform/release tests/release tests/unit/ci-workflow-generation.test.ts:
483 passed
- build-frontend.ts 뒤 verify-hosting-headers.ts(fixture): UNVERIFIED rc=3,
결과 36건(appRoute 8건 포함), SW null이라 serviceWorker 헤더 검사는 건너뜀
- tsc(node, test), eslint 바뀐 파일, verify-documentation-readiness
PASS_SCOPED, check-ci-contract PASS
Refs: docs/reviews/2026-11-01-maturity-review/13-build-release-supply-chain.md 13-04
This commit is contained in:
@@ -27,6 +27,19 @@
|
||||
},
|
||||
"sourceMap": {
|
||||
"public": false
|
||||
},
|
||||
"appRoute": {
|
||||
"path": "/__probe/deep-link",
|
||||
"cacheControl": "no-cache",
|
||||
"contentTypes": ["text/html"],
|
||||
"securityHeaders": true
|
||||
},
|
||||
"serviceWorker": {
|
||||
"path": "/service-worker.js",
|
||||
"requiredWhen": "service-worker-shipped",
|
||||
"cacheControl": "no-cache",
|
||||
"contentTypes": ["text/javascript", "application/javascript"],
|
||||
"securityHeaders": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,20 @@
|
||||
"hashedAsset": {
|
||||
"cache-control": "public, max-age=31536000, immutable",
|
||||
"content-type": "text/javascript; charset=utf-8"
|
||||
},
|
||||
"appRoute": {
|
||||
"cache-control": "no-cache",
|
||||
"content-type": "text/html; charset=utf-8",
|
||||
"content-security-policy": "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; form-action 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self' https:; font-src 'self'; upgrade-insecure-requests",
|
||||
"strict-transport-security": "max-age=31536000; includeSubDomains",
|
||||
"x-frame-options": "DENY",
|
||||
"referrer-policy": "strict-origin-when-cross-origin",
|
||||
"x-content-type-options": "nosniff",
|
||||
"permissions-policy": "camera=(), microphone=(), geolocation=()"
|
||||
},
|
||||
"serviceWorker": {
|
||||
"cache-control": "no-cache",
|
||||
"content-type": "text/javascript; charset=utf-8"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,10 @@ The provider-independent cache defaults are:
|
||||
|
||||
- hashed assets: `public, max-age=31536000, immutable`
|
||||
- HTML: `no-cache`
|
||||
- app routes: the router uses browser history, so every path the build has
|
||||
no file for (a reload, a bookmark, a shared link) is answered with the
|
||||
release's `index.html` and the HTML headers (SPA fallback). A missing
|
||||
hashed asset stays a 404; it never falls back to HTML
|
||||
- runtime config and release manifest: `no-store`
|
||||
- public source maps: disabled
|
||||
- service worker/offline cache: disabled, unless the static selection in
|
||||
@@ -63,6 +67,80 @@ HTTPS root URL. Each required surface must return HTTP 200 without leaving that
|
||||
origin before its cache, content-type, and security headers can count as
|
||||
deployment evidence. The hashed asset it requests is the entry script named by
|
||||
the served `index.html`, so it checks the release that is actually deployed.
|
||||
It also requests `appRoute` (`/__probe/deep-link`, a path no build has a file
|
||||
for): the host must answer 200 with the same `index.html` (the same entry
|
||||
script) and the HTML headers, so a host without the SPA fallback fails
|
||||
(review 1101/13-04). When the build ships a worker it requests
|
||||
`/service-worker.js` and expects `no-cache`. The surfaces and their headers are
|
||||
declared in `config/hosting/cache-policy.json`.
|
||||
|
||||
### Example: nginx on a single server
|
||||
|
||||
Written by hand for the default base path `/`; nothing in CI runs it. The live
|
||||
probe above is what checks the host. `add_header` in a `location` replaces the
|
||||
ones inherited from `server`, so the security headers
|
||||
(`config/hosting/security-headers.json`) are an include repeated in each block.
|
||||
|
||||
```nginx
|
||||
# /etc/nginx/snippets/frontend-security-headers.conf
|
||||
add_header Content-Security-Policy "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; form-action 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self' https:; font-src 'self'; upgrade-insecure-requests" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
add_header X-Frame-Options "DENY" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
||||
```
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name app.example.com;
|
||||
# ssl_certificate / ssl_certificate_key ...
|
||||
|
||||
# The active release directory. Switch it with an atomic symlink rename.
|
||||
root /srv/frontend/current;
|
||||
|
||||
# index.html, and every app route through the fallback below.
|
||||
location = /index.html {
|
||||
add_header Cache-Control "no-cache";
|
||||
include snippets/frontend-security-headers.conf;
|
||||
}
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
include snippets/frontend-security-headers.conf;
|
||||
}
|
||||
|
||||
location = /config.json {
|
||||
add_header Cache-Control "no-store";
|
||||
include snippets/frontend-security-headers.conf;
|
||||
}
|
||||
location = /release-manifest.json {
|
||||
add_header Cache-Control "no-store";
|
||||
include snippets/frontend-security-headers.conf;
|
||||
}
|
||||
|
||||
# Hashed files of every retained release in one directory (names never
|
||||
# collide). Prune by age, not on switch. A missing chunk is a 404, never
|
||||
# index.html: an old tab has to see the failure to reload once (FE-RB-002).
|
||||
location /assets/ {
|
||||
root /srv/frontend/shared;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Only when the build ships a worker (cache-policy.json `serviceWorker`).
|
||||
location = /service-worker.js {
|
||||
add_header Cache-Control "no-cache";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location ~ \.map$ {
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`Cache-Control` has no `always`, so a 404 is never stored as immutable.
|
||||
|
||||
FE-GATE-019 is therefore a production-stage gate (`production_gate` job,
|
||||
`PROD_PROMOTION_READY`). It runs after `promotion` and after the project has
|
||||
|
||||
@@ -28,6 +28,104 @@ export function servedEntryScript(indexHtml: string): string | null {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
export type ProbeResult = Readonly<{
|
||||
surface: string;
|
||||
header: string;
|
||||
expected: unknown;
|
||||
observed: unknown;
|
||||
reason?: string;
|
||||
passed: boolean;
|
||||
}>;
|
||||
export type ResponseHeaders = Record<string, Record<string, string>>;
|
||||
export type HostingFetcher = (url: URL) => Promise<Response>;
|
||||
|
||||
/**
|
||||
* 13-05 (D-14). Runs after the promoted release is deployed. Every surface must
|
||||
* answer 200 without leaving the probed origin, and the hashed asset it
|
||||
* requests is the entry script the served index.html names.
|
||||
*
|
||||
* 1101/13-04. `appRoute` is a path the build has no file for. The router uses
|
||||
* browser history, so a reload or a shared link of any route reaches the host
|
||||
* as such a path, and the host must answer it with the same index.html (SPA
|
||||
* fallback). A 404 or any other page there fails, although `/` still works.
|
||||
*/
|
||||
export async function probeLiveRelease(
|
||||
base: URL,
|
||||
paths: Readonly<Record<string, string>>,
|
||||
fetcher: HostingFetcher = (url) => fetch(url, { redirect: "follow" }),
|
||||
): Promise<{ responses: ResponseHeaders; results: ProbeResult[] }> {
|
||||
const responses: ResponseHeaders = {};
|
||||
const results: ProbeResult[] = [];
|
||||
const probe = async (surface: string, pathname: string): Promise<string | null> => {
|
||||
try {
|
||||
const response = await fetcher(new URL(pathname, base));
|
||||
const finalOrigin = new URL(response.url).origin;
|
||||
results.push(
|
||||
{
|
||||
surface,
|
||||
header: "http-status",
|
||||
expected: 200,
|
||||
observed: response.status,
|
||||
passed: response.status === 200,
|
||||
},
|
||||
{
|
||||
surface,
|
||||
header: "final-origin",
|
||||
expected: base.origin,
|
||||
observed: finalOrigin,
|
||||
passed: finalOrigin === base.origin,
|
||||
},
|
||||
);
|
||||
responses[surface] = Object.fromEntries(
|
||||
[...response.headers.entries()].map(([name, value]) => [name.toLowerCase(), value]),
|
||||
);
|
||||
return await response.text();
|
||||
} catch (error: unknown) {
|
||||
results.push({
|
||||
surface,
|
||||
header: "transport",
|
||||
expected: "reachable",
|
||||
observed: error instanceof Error ? error.name : "UnknownError",
|
||||
passed: false,
|
||||
});
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
const bodies: Record<string, string | null> = {};
|
||||
for (const [surface, pathname] of Object.entries(paths)) {
|
||||
bodies[surface] = await probe(surface, pathname);
|
||||
}
|
||||
const entryScript = servedEntryScript(bodies["index"] ?? "");
|
||||
if (entryScript) {
|
||||
await probe("hashedAsset", entryScript);
|
||||
} else {
|
||||
results.push({
|
||||
surface: "hashedAsset",
|
||||
header: "entry-script",
|
||||
expected: "a module script named by the served index.html",
|
||||
observed: null,
|
||||
passed: false,
|
||||
});
|
||||
}
|
||||
if ("appRoute" in paths) {
|
||||
const observed = servedEntryScript(bodies["appRoute"] ?? "");
|
||||
results.push({
|
||||
surface: "appRoute",
|
||||
header: "entry-script",
|
||||
expected: entryScript,
|
||||
observed,
|
||||
passed: entryScript !== null && observed === entryScript,
|
||||
});
|
||||
}
|
||||
return { responses, results };
|
||||
}
|
||||
|
||||
/** A build ships a worker script for these selections (06-03: REMOVE_REGISTRATION ships the self-unregistering one). */
|
||||
export function shipsServiceWorker(selection: InstalledServiceWorkerSelection | null): boolean {
|
||||
return selection?.mode === "ACTIVE" || selection?.mode === "REMOVE_REGISTRATION";
|
||||
}
|
||||
|
||||
const PUBLIC_SERVICE_WORKER = /(?:^|\/)(?:service-worker|sw)(?:[.-][^/]*)?\.js$/i;
|
||||
|
||||
/**
|
||||
@@ -41,9 +139,7 @@ export function checkPublicServiceWorkers(
|
||||
) {
|
||||
const found = distFiles.filter((file) => PUBLIC_SERVICE_WORKER.test(file));
|
||||
const allowed: string[] =
|
||||
selection?.mode === "ACTIVE" || selection?.mode === "REMOVE_REGISTRATION"
|
||||
? [selection.scriptPath]
|
||||
: [];
|
||||
selection && shipsServiceWorker(selection) ? [selection.scriptPath] : [];
|
||||
const passed =
|
||||
found.length === allowed.length &&
|
||||
found.every((file) => allowed.includes(file));
|
||||
|
||||
@@ -6,21 +6,15 @@ import {
|
||||
checkPublicServiceWorkers,
|
||||
classifyLiveHostingBaseUrl,
|
||||
hostingVerdict,
|
||||
servedEntryScript,
|
||||
probeLiveRelease,
|
||||
shipsServiceWorker,
|
||||
type HostingMode,
|
||||
type ProbeResult,
|
||||
type ResponseHeaders,
|
||||
} from "./lib/hosting-probe.ts";
|
||||
import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts";
|
||||
|
||||
type Document = Record<string, unknown>;
|
||||
type ResponseHeaders = Record<string, Record<string, string>>;
|
||||
type ProbeResult = Readonly<{
|
||||
surface: string;
|
||||
header: string;
|
||||
expected: unknown;
|
||||
observed: unknown;
|
||||
reason?: string;
|
||||
passed: boolean;
|
||||
}>;
|
||||
|
||||
function isRecord(value: unknown): value is Document {
|
||||
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
||||
@@ -70,68 +64,26 @@ const liveTarget = baseUrl ? classifyLiveHostingBaseUrl(baseUrl) : null;
|
||||
const distFiles = (await readdir("dist", { recursive: true })).map(String);
|
||||
const publicSourceMaps = distFiles.filter((file) => file.endsWith(".map"));
|
||||
|
||||
// 1101/13-04. The worker script surface exists only in a build that ships one.
|
||||
const workerShipped = shipsServiceWorker(INSTALLED_RUNTIME_CAPABILITIES.serviceWorker);
|
||||
const requiredSurfaces = Object.entries(cacheSurfaces)
|
||||
.map(([surface, policy]) => [surface, recordValue(policy)] as const)
|
||||
.filter(([, policy]) => policy.requiredWhen !== "service-worker-shipped" || workerShipped);
|
||||
|
||||
let responses: ResponseHeaders = {};
|
||||
let mode: HostingMode;
|
||||
const probeResults: ProbeResult[] = [];
|
||||
|
||||
if (liveTarget?.passed) {
|
||||
mode = "live";
|
||||
// 13-05: FE-GATE-019 runs after the promoted release is deployed, and the
|
||||
// hashed asset it probes is the entry script that release's index.html names.
|
||||
const probe = async (surface: string, pathname: string): Promise<string | null> => {
|
||||
const requestedUrl = new URL(pathname, liveTarget.url);
|
||||
try {
|
||||
const response = await fetch(requestedUrl, { redirect: "follow" });
|
||||
const finalUrl = new URL(response.url);
|
||||
probeResults.push(
|
||||
{
|
||||
surface,
|
||||
header: "http-status",
|
||||
expected: 200,
|
||||
observed: response.status,
|
||||
passed: response.status === 200,
|
||||
},
|
||||
{
|
||||
surface,
|
||||
header: "final-origin",
|
||||
expected: liveTarget.url.origin,
|
||||
observed: finalUrl.origin,
|
||||
passed: finalUrl.origin === liveTarget.url.origin,
|
||||
},
|
||||
);
|
||||
responses[surface] = Object.fromEntries(
|
||||
[...response.headers.entries()].map(([name, value]) => [
|
||||
name.toLowerCase(),
|
||||
value,
|
||||
]),
|
||||
);
|
||||
return await response.text();
|
||||
} catch (error: unknown) {
|
||||
probeResults.push({
|
||||
surface,
|
||||
header: "transport",
|
||||
expected: "reachable",
|
||||
observed: error instanceof Error ? error.name : "UnknownError",
|
||||
passed: false,
|
||||
});
|
||||
return null;
|
||||
}
|
||||
};
|
||||
const indexHtml = await probe("index", "/");
|
||||
await probe("runtimeConfig", "/config.json");
|
||||
await probe("releaseManifest", "/release-manifest.json");
|
||||
const entryScript = indexHtml === null ? null : servedEntryScript(indexHtml);
|
||||
if (entryScript) {
|
||||
await probe("hashedAsset", entryScript);
|
||||
} else {
|
||||
probeResults.push({
|
||||
surface: "hashedAsset",
|
||||
header: "entry-script",
|
||||
expected: "a module script named by the served index.html",
|
||||
observed: null,
|
||||
passed: false,
|
||||
});
|
||||
}
|
||||
const paths = Object.fromEntries(
|
||||
requiredSurfaces.flatMap(([surface, policy]) =>
|
||||
typeof policy.path === "string" ? [[surface, policy.path] as const] : [],
|
||||
),
|
||||
);
|
||||
const probed = await probeLiveRelease(liveTarget.url, paths);
|
||||
responses = probed.responses;
|
||||
probeResults.push(...probed.results);
|
||||
} else if (liveTarget) {
|
||||
mode = "invalid-live";
|
||||
probeResults.push({
|
||||
@@ -151,8 +103,7 @@ if (liveTarget?.passed) {
|
||||
}
|
||||
|
||||
const results: ProbeResult[] = [...probeResults];
|
||||
for (const [surface, rawPolicy] of Object.entries(cacheSurfaces)) {
|
||||
const policy = recordValue(rawPolicy);
|
||||
for (const [surface, policy] of requiredSurfaces) {
|
||||
if (typeof policy.cacheControl !== "string") continue;
|
||||
const contentTypes = strings(policy.contentTypes);
|
||||
const observed = responses[surface]?.["cache-control"];
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
checkPublicServiceWorkers,
|
||||
classifyLiveHostingBaseUrl,
|
||||
hostingVerdict,
|
||||
probeLiveRelease,
|
||||
servedEntryScript,
|
||||
} from "../../scripts/lib/hosting-probe.ts";
|
||||
import { SERVICE_WORKER_SCRIPT_PATH } from "../../src/contracts/service-worker.ts";
|
||||
|
||||
describe("public service worker in dist", () => {
|
||||
const app = ["index.html", "config.json", "assets/index-abc.js"];
|
||||
@@ -96,3 +100,76 @@ describe("hosting header verdict", () => {
|
||||
expect(servedEntryScript("<html><body>maintenance</body></html>")).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
// 1101/13-04. The router uses browser history, so a reload or a shared link of
|
||||
// any route reaches the host as a path the build has no file for. The host has
|
||||
// to answer it with the release's index.html; without that fallback `/` still
|
||||
// opens and only deep links are 404, which no other check sees.
|
||||
describe("SPA fallback and worker script surfaces (1101/13-04)", () => {
|
||||
type Surface = Partial<{
|
||||
path: string;
|
||||
cacheControl: string;
|
||||
contentTypes: string[];
|
||||
securityHeaders: boolean;
|
||||
requiredWhen: string;
|
||||
}>;
|
||||
const surfaces = async () =>
|
||||
(JSON.parse(await readFile("config/hosting/cache-policy.json", "utf8")) as {
|
||||
surfaces: Record<string, Surface | undefined>;
|
||||
}).surfaces;
|
||||
|
||||
it("declares an app route the build has no file for, served like index.html", async () => {
|
||||
const { appRoute, index } = await surfaces();
|
||||
expect(appRoute).toMatchObject({
|
||||
cacheControl: index?.cacheControl,
|
||||
contentTypes: index?.contentTypes,
|
||||
securityHeaders: true,
|
||||
});
|
||||
expect(appRoute?.path).toMatch(/^\/[^.]+$/u);
|
||||
const { responses } = JSON.parse(
|
||||
await readFile("config/hosting/response-headers.fixture.json", "utf8"),
|
||||
) as { responses: Record<string, unknown> };
|
||||
expect(responses["appRoute"]).toEqual(responses["index"]);
|
||||
});
|
||||
|
||||
it("declares the worker script, served no-cache, only for a build that ships it", async () => {
|
||||
expect((await surfaces())["serviceWorker"]).toMatchObject({
|
||||
path: `/${SERVICE_WORKER_SCRIPT_PATH}`,
|
||||
cacheControl: "no-cache",
|
||||
requiredWhen: "service-worker-shipped",
|
||||
});
|
||||
});
|
||||
|
||||
const INDEX = '<script type="module" src="/assets/index-A1.js"></script>';
|
||||
const PATHS = { index: "/", runtimeConfig: "/config.json", appRoute: "/__probe/deep-link" };
|
||||
const RELEASE: Record<string, [number, string]> = {
|
||||
"/": [200, INDEX],
|
||||
"/config.json": [200, "{}"],
|
||||
"/assets/index-A1.js": [200, ""],
|
||||
};
|
||||
const host = (routes: Record<string, [number, string]>) => async (url: URL) => {
|
||||
const [status, body] = routes[url.pathname] ?? [404, "Not Found"];
|
||||
const response = new Response(body, { status, headers: { "cache-control": "no-cache" } });
|
||||
Object.defineProperty(response, "url", { value: url.href });
|
||||
return response;
|
||||
};
|
||||
const base = new URL("https://frontend.example.test/");
|
||||
const failed = async (routes: Record<string, [number, string]>) =>
|
||||
(await probeLiveRelease(base, PATHS, host(routes))).results
|
||||
.filter((result) => !result.passed)
|
||||
.map((result) => `${result.surface} ${result.header}`);
|
||||
|
||||
it("passes a host that answers every route with the release's index.html", async () => {
|
||||
expect(await failed({ ...RELEASE, "/__probe/deep-link": [200, INDEX] })).toEqual([]);
|
||||
});
|
||||
|
||||
it("fails a host without the fallback", async () => {
|
||||
expect(await failed(RELEASE)).toEqual(["appRoute http-status", "appRoute entry-script"]);
|
||||
});
|
||||
|
||||
it("fails a fallback that answers 200 with a page that is not the release's index.html", async () => {
|
||||
expect(
|
||||
await failed({ ...RELEASE, "/__probe/deep-link": [200, "<h1>Not found</h1>"] }),
|
||||
).toEqual(["appRoute entry-script"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user