fix(service-worker): preserve redirect policy on reconstructed asset requests#67494
Open
Yenya030 wants to merge 1 commit intoangular:mainfrom
Open
fix(service-worker): preserve redirect policy on reconstructed asset requests#67494Yenya030 wants to merge 1 commit intoangular:mainfrom
Yenya030 wants to merge 1 commit intoangular:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
41f5dfb to
a0796ef
Compare
…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.
a0796ef to
58bf5ec
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.