aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-08-06 21:25:33 -0700
committerAnton Tananaev <anton@traccar.org>2022-08-06 21:25:33 -0700
commit980956695258be1ff464923c76c1c6db1df397c1 (patch)
treed66885fef082409f548ff51c7aa21a86f9a1a052
parentd59d3a9b40f11a5d99e6a1b2ae8c1828b5be8abc (diff)
downloadtrackermap-web-980956695258be1ff464923c76c1c6db1df397c1.tar.gz
trackermap-web-980956695258be1ff464923c76c1c6db1df397c1.tar.bz2
trackermap-web-980956695258be1ff464923c76c1c6db1df397c1.zip
Fix report exporting issuev5.3
-rw-r--r--modern/src/service-worker.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/modern/src/service-worker.js b/modern/src/service-worker.js
index 0f1e0ce0..718ed766 100644
--- a/modern/src/service-worker.js
+++ b/modern/src/service-worker.js
@@ -28,19 +28,28 @@ const fileExtensionRegexp = new RegExp('/[^/?]+\\.[^/]+$');
registerRoute(
// Return false to exempt requests from being fulfilled by index.html.
({ request, url }) => {
+
// If this isn't a navigation, skip.
if (request.mode !== 'navigate') {
return false;
- } // If this is a URL that starts with /_, skip.
+ }
- if (url.pathname.startsWith('/_')) {
+ // If this is a URL that starts with /api/, skip.
+ if (url.pathname.startsWith('/api/')) {
return false;
- } // If this looks like a URL for a resource, because it contains // a file extension, skip.
+ }
+ // If this is a URL that starts with /_, skip.
+ if (url.pathname.startsWith('/_')) {
+ 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 to signal that we want to use the handler.
return true;
},
createHandlerBoundToURL(process.env.PUBLIC_URL + '/index.html')