Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cleanRedirect logic #1678

Merged
merged 1 commit into from
Oct 4, 2018
Merged

Fix cleanRedirect logic #1678

merged 1 commit into from
Oct 4, 2018

Conversation

jeffposnick
Copy link
Contributor

R: @philipwalton

While investigating #1677 I realized that there's a bug in the Request constructor usage inside the code that "cleans up" redirected responses.

The code in this PR just takes the corresponding code from sw-precache's implementation, which should work.

I'm filing this PR against next because I don't think it's an urgent bug to fix, and I'd rather we don't cut any additional v3 releases if we can help it.

@@ -17,8 +17,12 @@
// Stub missing/broken Headers API methods in `service-worker-mock`.
// https://fetch.spec.whatwg.org/#headers-class
class Headers {
constructor(obj = {}) {
this.obj = Object.assign({}, obj);
constructor(init = {}) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@philipwalton philipwalton left a comment

Choose a reason for hiding this comment

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

LGTM, do we want to merge this into master to fix the bug more quickly, or do you want to save this for v4?

@jeffposnick
Copy link
Contributor Author

I'm filing this PR against next because I don't think it's an urgent bug to fix, and I'd rather we don't cut any additional v3 releases if we can help it.

@workbox-pr-bot
Copy link
Collaborator

PR-Bot Size Plugin

Changed File Sizes

File Before After Change GZipped
packages/workbox-background-sync/build/workbox-background-sync.prod.js 3.51 KB 3.09 KB -12% 1.39 KB 🎉
packages/workbox-broadcast-cache-update/build/workbox-broadcast-cache-update.prod.js 1.12 KB 1.88 KB +68% 935 B ☠️
packages/workbox-build/build/index.js 4.02 KB 4.04 KB +0% 1.57 KB
packages/workbox-cache-expiration/build/workbox-cache-expiration.prod.js 3.88 KB 3.12 KB -20% 1.28 KB 🎉
packages/workbox-cli/build/app.js 6.76 KB 5.05 KB -25% 1.91 KB 🎉
packages/workbox-cli/build/bin.js 2.32 KB 1.57 KB -32% 799 B 🎉
packages/workbox-core/build/workbox-core.prod.js 7.47 KB 5.98 KB -20% 2.62 KB 🎉
packages/workbox-google-analytics/build/workbox-google-analytics.prod.js 2.12 KB 1.90 KB -11% 962 B 🎉
packages/workbox-precaching/build/workbox-precaching.prod.js 5.81 KB 5.03 KB -13% 2.12 KB 🎉
packages/workbox-range-requests/build/workbox-range-requests.prod.js 1.63 KB 1.49 KB -8% 744 B
packages/workbox-strategies/build/workbox-strategies.prod.js 5.09 KB 4.33 KB -15% 1.12 KB 🎉
packages/workbox-streams/build/workbox-streams.prod.js 1.57 KB 1.38 KB -12% 680 B 🎉
packages/workbox-webpack-plugin/build/generate-sw.js 8.04 KB 5.69 KB -29% 2.07 KB 🎉
packages/workbox-webpack-plugin/build/index.js 742 B 746 B +1% 468 B
packages/workbox-webpack-plugin/build/inject-manifest.js 10.30 KB 7.31 KB -29% 2.61 KB 🎉

New Files

No new files have been added.

All File Sizes

View Table
File Before After Change GZipped
packages/workbox-background-sync/build/workbox-background-sync.prod.js 3.51 KB 3.09 KB -12% 1.39 KB 🎉
packages/workbox-broadcast-cache-update/build/workbox-broadcast-cache-update.prod.js 1.12 KB 1.88 KB +68% 935 B ☠️
packages/workbox-build/build/_types.js 41 B 41 B 0% 61 B
packages/workbox-build/build/index.js 4.02 KB 4.04 KB +0% 1.57 KB
packages/workbox-cache-expiration/build/workbox-cache-expiration.prod.js 3.88 KB 3.12 KB -20% 1.28 KB 🎉
packages/workbox-cacheable-response/build/workbox-cacheable-response.prod.js 587 B 587 B 0% 347 B
packages/workbox-cli/build/app.js 6.76 KB 5.05 KB -25% 1.91 KB 🎉
packages/workbox-cli/build/bin.js 2.32 KB 1.57 KB -32% 799 B 🎉
packages/workbox-core/build/workbox-core.prod.js 7.47 KB 5.98 KB -20% 2.62 KB 🎉
packages/workbox-google-analytics/build/workbox-google-analytics.prod.js 2.12 KB 1.90 KB -11% 962 B 🎉
packages/workbox-navigation-preload/build/workbox-navigation-preload.prod.js 660 B 660 B 0% 319 B
packages/workbox-precaching/build/workbox-precaching.prod.js 5.81 KB 5.03 KB -13% 2.12 KB 🎉
packages/workbox-range-requests/build/workbox-range-requests.prod.js 1.63 KB 1.49 KB -8% 744 B
packages/workbox-routing/build/workbox-routing.prod.js 2.87 KB 2.87 KB 0% 1.31 KB
packages/workbox-strategies/build/workbox-strategies.prod.js 5.09 KB 4.33 KB -15% 1.12 KB 🎉
packages/workbox-streams/build/workbox-streams.prod.js 1.57 KB 1.38 KB -12% 680 B 🎉
packages/workbox-sw/build/workbox-sw.js 1.50 KB 1.50 KB 0% 811 B
packages/workbox-webpack-plugin/build/generate-sw.js 8.04 KB 5.69 KB -29% 2.07 KB 🎉
packages/workbox-webpack-plugin/build/index.js 742 B 746 B +1% 468 B
packages/workbox-webpack-plugin/build/inject-manifest.js 10.30 KB 7.31 KB -29% 2.61 KB 🎉

Workbox Aggregate Size Plugin

9.38KB gzip'ed (63% of limit)
22.86KB uncompressed

@jeffposnick jeffposnick merged commit ef492be into next Oct 4, 2018
@jeffposnick jeffposnick deleted the fix-cleanRedirect branch October 4, 2018 21:04
jeffposnick added a commit that referenced this pull request Oct 19, 2018
jeffposnick added a commit that referenced this pull request Oct 19, 2018
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