diff --git a/sw.js b/sw.js index 91329e3..542852e 100644 --- a/sw.js +++ b/sw.js @@ -13,8 +13,10 @@ var cacheName = 'chirpy-{{ "now" | date: "%Y%m%d.%H%M" }}'; function isExcluded(url) { + const regex = /(^http(s)?|^\/)/; /* the regex for CORS url or relative url */ for (const rule of exclude) { - if (url.indexOf(rule) != -1) { + if (!regex.test(url) || + url.indexOf(rule) != -1) { return true; } }