Fix RegExp from navigateFallbackBlacklist (workbox) (#7176)

Exclude URLs that contains a "?" character.
This commit is contained in:
Andrea Puddu
2019-08-09 00:07:50 +02:00
committed by Ian Sutherland
parent 9678bbb4bf
commit efaee65e90

View File

@@ -664,9 +664,11 @@ module.exports = function(webpackEnv) {
navigateFallbackBlacklist: [
// Exclude URLs starting with /_, as they're likely an API call
new RegExp('^/_'),
// Exclude URLs containing a dot, as they're likely a resource in
// public/ and not a SPA route
new RegExp('/[^/]+\\.[^/]+$'),
// Exclude any URLs whose last part seems to be a file extension
// as they're likely a resource and not a SPA route.
// URLs containing a "?" character won't be blacklisted as they're likely
// a route with query params (e.g. auth callbacks).
new RegExp('/[^/?]+\\.[^/]+$'),
],
}),
// TypeScript type checking