Skip to content
Snippets Groups Projects
Commit 3705cd83 authored by Akihiko Odaki's avatar Akihiko Odaki Committed by Eugen Rochko
Browse files

Clone response before using when caching web page (#7498)

parent 7fe2993b
No related branches found
No related tags found
No related merge requests found
......@@ -30,8 +30,8 @@ self.addEventListener('fetch', function(event) {
event.respondWith(asyncResponse.then(response => {
if (response.ok) {
return asyncCache.then(cache => cache.put('/', response))
.then(() => response.clone());
return asyncCache.then(cache => cache.put('/', response.clone()))
.then(() => response);
}
throw null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment