Browse Source

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

pull/4/head
Akihiko Odaki 6 years ago
committed by Eugen Rochko
parent
commit
3705cd8322
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/javascript/mastodon/service_worker/entry.js

+ 2
- 2
app/javascript/mastodon/service_worker/entry.js View File

@ -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;

Loading…
Cancel
Save