From efaee65e9068277dbf71c4b28811d80736996f2b Mon Sep 17 00:00:00 2001 From: Andrea Puddu Date: Fri, 9 Aug 2019 00:07:50 +0200 Subject: [PATCH] Fix RegExp from navigateFallbackBlacklist (workbox) (#7176) Exclude URLs that contains a "?" character. --- packages/react-scripts/config/webpack.config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 69aa3342..dad50a31 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -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