fix(service-worker): preserve redirect policy on reconstructed asset requests - #67494
Merged
mattrbeck merged 2 commits intoMar 18, 2026
Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
…requests Preserve the redirect mode when rebuilding asset requests in newRequestWithMetadata(). This keeps explicit redirect:error semantics intact across service-worker redirect handling. Update the worker test mocks to model redirect defaults correctly and add focused regression coverage for redirected lazy assets with redirect:error.
Author
|
Hello @kirjs, Have you had a chance to review my PR? Thanks! |
Author
|
@kirjs , Its been more than a week can I get a review of my pull request? |
JeanMeche
reviewed
Mar 17, 2026
Use the typed Response.redirected property directly in the service-worker test mock instead of casting to any.
Author
|
@kirjs waiting for your review to finish this pull request. |
Member
Author
|
Great thanks for the update! |
Author
|
Issue ID 493348512 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
AssetGroup.newRequestWithMetadata()reconstructs requests while preserving headers only.In redirect handling paths (
AssetGroup.fetchFromNetwork()), this drops an explicitredirectpolicy from the original request. As a result, a request made withredirect: 'error'can be reconstructed without that policy and continue through redirect-following behavior in the SW asset fetch path.Issue Number: N/A
What is the new behavior?
redirectwhen reconstructing requests innewRequestWithMetadata().redirectsemantics.redirect: 'error'is specified.Does this PR introduce a breaking change?
Other information
Test plan (executed locally):
bazelisk test --nocache_test_results //packages/service-worker/worker/test:test --test_arg=--filter="redirect policy is error|handles redirected responses|passes headers through to the server|does not pass non-allowed metadata through to the server"bazelisk test --nocache_test_results //packages/service-worker/worker/test:testbazelisk test --nocache_test_results //packages/service-worker/test:testNo docs were updated because this is an internal service worker request-metadata bugfix with regression coverage in existing test suites.