angular-cn/packages/service-worker/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
..
src fix(service-worker): freshness strategy should clone response for cache (#19764) 2017-10-18 11:18:34 -07:00
test fix(service-worker): several misc fixes for corner cases 2017-10-05 13:27:31 -07:00
testing fix(service-worker): freshness strategy should clone response for cache (#19764) 2017-10-18 11:18:34 -07:00
main.ts feat(service-worker): introduce the @angular/service-worker package (#19274) 2017-09-28 16:18:12 -07:00
rollup-worker.config.js feat(service-worker): introduce the @angular/service-worker package (#19274) 2017-09-28 16:18:12 -07:00
tsconfig.json feat(service-worker): introduce the @angular/service-worker package (#19274) 2017-09-28 16:18:12 -07:00