mozilla / wp-offline-shell

This WordPress plugin provides a method for caching theme assets via a service worker.
Other
53 stars 16 forks source link

Fix #81 - Prevent normalize/referrer from causing referrer problem. #83

Closed darkwing closed 8 years ago

darkwing commented 8 years ago

This prevents the referrer problem as seen in issue #81 .

darkwing commented 8 years ago

We still see this in the Chrome console:

chromeissue

But IMO it's better than Firefox throwing a fetch error.

darkwing commented 8 years ago

@marco-c @delapuente

delapuente commented 8 years ago

With this PR, caching x-origin resources is lost. Or it is an intentional change (so in that case we should change the name of the method to something like normalize() as we are anonymizing no more) or we must revert this change and simply delete referrer which is a more suitable specific solution.

marco-c commented 8 years ago

@delapuente I think this PR hasn't modified the previous behavior for cross-origin requests. We're using the URL of the request to find an element in the cache, and if an element isn't found we're using fetch with the original request.

delapuente commented 8 years ago

From this line, I realized we don't reuse the url for fetching, only for cache matching. Then, there is no alteration in the semantics but I would recommend changing the name of the method to not lead to misconceptions #86.