chore(review): 1106 Service Worker·호스팅 조치 브랜치를 합친다

This commit is contained in:
DongHyeonka
2026-11-06 07:02:34 +09:00
5 changed files with 81 additions and 11 deletions
+17
View File
@@ -125,6 +125,12 @@ export function releaseIdentity(manifest: string | null): ReleaseIdentity | null
*
* 1103/13-02. The host must negotiate a declared protocol (HTTP/2): the
* template splits its initial chunks on that premise.
*
* 1106/06-01. The worker script alone must also answer without any redirect.
* Browsers fetch it with redirect mode "error" (the Service Worker Update
* algorithm), so a same-origin redirect breaks registration, every update
* check and the REMOVE_REGISTRATION kill switch, although the followed answer
* is a 200 with the right headers. Pages may still follow a redirect.
*/
export async function probeLiveRelease(
base: URL,
@@ -156,6 +162,17 @@ export async function probeLiveRelease(
passed: finalOrigin === base.origin,
},
);
if (surface === "serviceWorker") {
const redirected = response.redirected || response.type === "opaqueredirect";
results.push({
surface,
header: "redirect",
expected: false,
observed: redirected,
...(redirected ? { reason: "browsers refuse a redirected worker script" } : {}),
passed: !redirected,
});
}
responses[surface] = Object.fromEntries(
[...response.headers.entries()].map(([name, value]) => [name.toLowerCase(), value]),
);