diff options
author | Anton Tananaev <anton@traccar.org> | 2022-08-06 21:25:33 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-08-06 21:25:33 -0700 |
commit | 980956695258be1ff464923c76c1c6db1df397c1 (patch) | |
tree | d66885fef082409f548ff51c7aa21a86f9a1a052 | |
parent | d59d3a9b40f11a5d99e6a1b2ae8c1828b5be8abc (diff) | |
download | trackermap-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.js | 19 |
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') |