Skip to content

Feat/redirect handling - #58

Open
a-d-j-i wants to merge 2 commits into
feat/warning-view-infrafrom
feat/redirect-handling
Open

a-d-j-i wants to merge 2 commits into
feat/warning-view-infrafrom
feat/redirect-handling

Conversation

@a-d-j-i

@a-d-j-i a-d-j-i commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Keys manifest lookup by response.url for followed redirects: response-wrapper carries url + redirected; resolveManifestKey prefers response.url when non-empty and falls back to req.url for opaque-redirect and script-constructed Response. Fixes same-origin subresource redirects turning into NOT_FOUND. Adds sw-redirects.spec.ts covering server-issued redirect handling.

Lands docs/redirect-handling.md with the redirect issues and our plan.

Adds child-SW probe routes in sw_app.js (manual/follow/error/respond-302/ respond-302-ext/add-headers/post) and sw-child-fetch.spec.ts covering redirect-mode overrides, headers/method tampering, synthesized 3xx (internal + cross-origin), and the server-302 escape-to-attacker gap. Plus a POC browser-platform probe pinning that SW-materialized 302 at <script> is followed by the browser.

createRedirectResponse now takes a status arg (301/302/303/307/308) with matching constant + fetch-handler + storage touch-ups. No functional change yet to shouldSkipVerification or the manifest schema.

@a-d-j-i
a-d-j-i force-pushed the feat/redirect-handling branch from dfc66b2 to 523d34a Compare October 16, 2026 18:05
@a-d-j-i
a-d-j-i force-pushed the feat/redirect-handling branch from 523d34a to 20b1632 Compare October 16, 2026 18:59
@a-d-j-i
a-d-j-i marked this pull request as ready for review October 19, 2026 12:20
@emiliorizzo
emiliorizzo requested a balanced review from Copilot October 19, 2026 14:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@emiliorizzo
emiliorizzo self-requested a review October 19, 2026 15:46
emiliorizzo
emiliorizzo previously approved these changes Oct 19, 2026
@a-d-j-i
a-d-j-i requested a review from a team as a code owner October 19, 2026 16:47
@a-d-j-i
a-d-j-i added this pull request to stack #54 October 20, 2026 16:46
@a-d-j-i
a-d-j-i dismissed emiliorizzo’s stale review October 20, 2026 16:46

The merge-base changed after approval.

@a-d-j-i
a-d-j-i force-pushed the feat/redirect-handling branch from ad9decf to cae35d0 Compare October 20, 2026 16:56
@a-d-j-i
a-d-j-i force-pushed the feat/redirect-handling branch from cae35d0 to f6f6623 Compare October 21, 2026 22:28
@a-d-j-i
a-d-j-i requested a review from emiliorizzo October 21, 2026 22:34
Keys manifest lookup by response.url for followed redirects:
response-wrapper carries url + redirected; resolveManifestKey prefers
response.url when non-empty and falls back to req.url for opaque-redirect
and script-constructed Response. Fixes same-origin subresource redirects
turning into NOT_FOUND. Adds sw-redirects.spec.ts covering server-issued
redirect handling.

Lands docs/redirect-handling.md with the redirect issues and our plan.

Adds child-SW probe routes in sw_app.js (manual/follow/error/respond-302/
respond-302-ext/add-headers/post) and sw-child-fetch.spec.ts covering
redirect-mode overrides, headers/method tampering, synthesized 3xx
(internal + cross-origin), and the server-302 escape-to-attacker gap.
Plus a POC browser-platform probe pinning that SW-materialized 302 at
<script> is followed by the browser.

createRedirectResponse now takes a status arg (301/302/303/307/308) with
matching constant + fetch-handler + storage touch-ups. No functional
change yet to shouldSkipVerification or the manifest schema.
Forcing-function fix for cross-origin redirect verification: devs declare
every allowed redirect source in a signed `manifest.redirects`, DF
synthesizes the response from the manifest and ignores whatever Location
the server/child-SW provided. Undeclared sources block.
@a-d-j-i
a-d-j-i force-pushed the feat/redirect-handling branch from f6f6623 to 35dc9f9 Compare October 22, 2026 21:43
@a-d-j-i
a-d-j-i removed this pull request from stack #54 October 22, 2026 21:43
@a-d-j-i
a-d-j-i changed the base branch from ui/warning-page-view-dispatch to feat/warning-view-infra October 22, 2026 21:44
@a-d-j-i
a-d-j-i added this pull request to stack #66 October 22, 2026 21:44

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants