From 901636b534a9f09f2679e1b588ba01489234fb22 Mon Sep 17 00:00:00 2001 From: nuragic Date: Sun, 9 Jun 2019 11:11:25 +0200 Subject: [PATCH] Fix RegExp from navigateFallbackBlacklist (workbox) 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 8f70442d584..903096aad0a 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -623,9 +623,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