test(runtime): verify live same-origin canary

This commit is contained in:
chick
2026-07-18 15:45:57 +08:00
parent f89f393485
commit 3718c91706
7 changed files with 185 additions and 6 deletions
+8
View File
@@ -256,6 +256,14 @@ export function createCanaryGateway(options: CanaryGatewayOptions): CanaryGatewa
return sendText(response, 405, 'Method Not Allowed');
}
// Browsers request this implicitly. Avoid a noisy console 404 without routing
// this file-like path through the SPA fallback.
if (pathname === '/favicon.ico') {
response.writeHead(204, { 'cache-control': 'no-cache' });
response.end();
return;
}
const distRoot = await realpath(resolve(options.distDir)).catch(() => resolve(options.distDir));
if (pathname !== '/' && (await serveFile(request, response, distRoot, pathname))) return;
if (