Skip to content

Commit 901636b

Browse files
committed
Fix RegExp from navigateFallbackBlacklist (workbox)
Exclude URLs that contains a "?" character.
1 parent f05465e commit 901636b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/react-scripts/config/webpack.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,11 @@ module.exports = function(webpackEnv) {
623623
navigateFallbackBlacklist: [
624624
// Exclude URLs starting with /_, as they're likely an API call
625625
new RegExp('^/_'),
626-
// Exclude URLs containing a dot, as they're likely a resource in
627-
// public/ and not a SPA route
628-
new RegExp('/[^/]+\\.[^/]+$'),
626+
// Exclude any URLs whose last part seems to be a file extension
627+
// as they're likely a resource and not a SPA route.
628+
// URLs containing a "?" character won't be blacklisted as they're likely
629+
// a route with query params (e.g. auth callbacks).
630+
new RegExp('/[^/?]+\\.[^/]+$'),
629631
],
630632
}),
631633
// TypeScript type checking

0 commit comments

Comments
 (0)