sw.js: fix match against undefined pathname
This commit is contained in:
parent
bb1275e51a
commit
c356597523
1 changed files with 5 additions and 1 deletions
|
@ -104,7 +104,11 @@ module.exports = merge(sharedConfig, {
|
||||||
];
|
];
|
||||||
|
|
||||||
const isBackendRoute = ({ pathname }) => {
|
const isBackendRoute = ({ pathname }) => {
|
||||||
return backendRoutes.some(pathname.startsWith);
|
if (pathname) {
|
||||||
|
return backendRoutes.some(pathname.startsWith);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return isBackendRoute(requestUrl) && requestUrl;
|
return isBackendRoute(requestUrl) && requestUrl;
|
||||||
|
|
Loading…
Reference in a new issue