[devdocsgjs/main: 823/1867] Fix #1054




commit 0b1adb5291b4f0e54fe7c2520148b7ef1cabf170
Author: Jasper van Merle <jaspervmerle gmail com>
Date:   Wed Aug 14 17:36:06 2019 +0200

    Fix #1054

 views/service-worker.js.erb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/views/service-worker.js.erb b/views/service-worker.js.erb
index aa234c19..722cd3fe 100644
--- a/views/service-worker.js.erb
+++ b/views/service-worker.js.erb
@@ -50,7 +50,7 @@ self.addEventListener('fetch', event => {
       <%# The index page will make sure the correct documentation or a proper offline page is shown  %>
       const pathname = url.pathname;
       const filename = pathname.substr(1 + pathname.lastIndexOf('/')).split(/\#|\?/g)[0];
-      if (url.origin === location.origin && !filename.includes('.')) {
+      if (url.origin === location.origin && !['.css', '.js', '.json', '.png', '.ico', '.svg', 
'.xml'].some(ext => filename.endsWith(ext))) {
         const cachedIndex = await caches.match('/');
         if (cachedIndex) return cachedIndex;
       }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]