Skip to content

Commit

Permalink
Fix RegExp from navigateFallbackBlacklist (workbox) (#7176)
Browse files Browse the repository at this point in the history
Exclude URLs that contains a "?" character.
  • Loading branch information
nuragic authored and iansu committed Aug 8, 2019
1 parent 9678bbb commit efaee65
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit efaee65

Please sign in to comment.