Skip to content

Commit

Permalink
Fix: only handle / with index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
dorianim committed Oct 7, 2022
1 parent 872a6cd commit f430326
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions client/src/service-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,8 @@ registerRoute(
return false;
}

// If this is a URL that starts with /_ or /api, skip.
if (url.pathname.startsWith('/_') || url.pathname.startsWith('/api')) {
return false;
}

// If this looks like a URL for a resource, because it contains
// a file extension, skip.
if (url.pathname.match(fileExtensionRegexp)) {
return false;
}

// Return true to signal that we want to use the handler.
return true;
// we are using a hash router, so all urls are /
return url.pathname === '/';
},
createHandlerBoundToURL(process.env.PUBLIC_URL + '/index.html'),
);
Expand Down

0 comments on commit f430326

Please sign in to comment.