angular-cn/packages/service-worker
Alex Rickabaugh 396c2417d9 fix(service-worker): freshness strategy should clone response for cache (#19764)
When Cache.put() is called with a Response, it consumes the response. If
the Response is used for any other purpose (such as satisfying the
original FetchEvent) it must be cloned first.

A bug exists in the mocks used for SW tests, where this condition is not
validated. The bodies of MockResponses can be utilized repeatedly without
erroring in the same way that a real browser would. This bug is fixed by
this commit, which causes tests for the freshness strategy of data caching
to start failing.

The cause of this failure is a second bug in the data caching code, where
the Response is not cloned prior to being passed to Cache.put(). This is
also fixed.

PR Close #19764
2017-10-18 11:18:34 -07:00
..
cli fix(service-worker): use posix path resolution for generation of ngsw.json (#19527) 2017-10-17 15:18:17 -07:00
config fix(service-worker): several misc fixes for corner cases 2017-10-05 13:27:31 -07:00
src fix(service-worker): add missing annotation for SwPush (#19721) 2017-10-17 10:38:45 -07:00
test fix(service-worker): add missing annotation for SwPush (#19721) 2017-10-17 10:38:45 -07:00
testing feat(service-worker): introduce the @angular/service-worker package (#19274) 2017-09-28 16:18:12 -07:00
worker fix(service-worker): freshness strategy should clone response for cache (#19764) 2017-10-18 11:18:34 -07:00
build.sh feat(service-worker): introduce the @angular/service-worker package (#19274) 2017-09-28 16:18:12 -07:00
package.json feat(service-worker): introduce the @angular/service-worker package (#19274) 2017-09-28 16:18:12 -07:00
public_api.ts feat(service-worker): introduce the @angular/service-worker package (#19274) 2017-09-28 16:18:12 -07:00
rollup.config.js feat(service-worker): introduce the @angular/service-worker package (#19274) 2017-09-28 16:18:12 -07:00
tsconfig-build.json feat(service-worker): introduce the @angular/service-worker package (#19274) 2017-09-28 16:18:12 -07:00