mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 00:54:02 -05:00
Clone response before using when caching web page (#7498)
This commit is contained in:
parent
7fe2993b87
commit
3705cd8322
@ -30,8 +30,8 @@ self.addEventListener('fetch', function(event) {
|
|||||||
|
|
||||||
event.respondWith(asyncResponse.then(response => {
|
event.respondWith(asyncResponse.then(response => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return asyncCache.then(cache => cache.put('/', response))
|
return asyncCache.then(cache => cache.put('/', response.clone()))
|
||||||
.then(() => response.clone());
|
.then(() => response);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw null;
|
throw null;
|
||||||
|
Loading…
Reference in New Issue
Block a user