about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2018-05-15 21:24:50 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-05-15 14:24:50 +0200
commit3705cd8322e4b49f5d75806be724decd0362fc90 (patch)
tree7b719ad6a3c472f5db940a34651b76b2c8e1ba0e /app/javascript
parent7fe2993b878339c277d9156f994c7e8ec21dd2ee (diff)
Clone response before using when caching web page (#7498)
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/service_worker/entry.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/service_worker/entry.js b/app/javascript/mastodon/service_worker/entry.js
index 5ad03caf2..9a3911b2a 100644
--- a/app/javascript/mastodon/service_worker/entry.js
+++ b/app/javascript/mastodon/service_worker/entry.js
@@ -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;