Commit 2f05ef8f authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Service Worker Treat ending / as index.html

parent c7ead705
...@@ -53,6 +53,9 @@ var global = self, window = self; ...@@ -53,6 +53,9 @@ var global = self, window = self;
var relative_url = event.request.url.split("#")[0] var relative_url = event.request.url.split("#")[0]
.replace(self.registration.scope, "") .replace(self.registration.scope, "")
.replace(self.version_url, ""); .replace(self.version_url, "");
if (relative_url[relative_url.length - 1] === "/" || relative_url === "") {
relative_url = relative_url + "index.html";
}
if (relative_url === './no-cache') { if (relative_url === './no-cache') {
event.respondWith(new Response(self.cache_list)); event.respondWith(new Response(self.cache_list));
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment