Browse Source

Fix 304 again

master
Eduard Kuzmenko 4 years ago
parent
commit
00eb061070
  1. 5
      src/lib/mtproto/mtproto.service.ts

5
src/lib/mtproto/mtproto.service.ts

@ -68,10 +68,9 @@ async function requestCache(event: FetchEvent) { @@ -68,10 +68,9 @@ async function requestCache(event: FetchEvent) {
cache.put(event.request, response.clone());
} else if(response.status === 304) { // possible fix for 304 in Safari
const url = event.request.url.replace(/\?.+$/, '') + '?' + (Math.random() * 100000 | 0);
const request = new Request(url);
response = await fetch(request);
response = await fetch(url);
if(isCorrectResponse(response)) {
cache.put(request, response.clone());
cache.put(event.request, response.clone());
}
}

Loading…
Cancel
Save