Merge branch 'sw-pathname-fix' into 'develop'

sw.js: fix match against undefined pathname

See merge request soapbox-pub/soapbox-fe!868
This commit is contained in:
Alex Gleason 2021-11-15 19:21:04 +00:00
commit 6e5ec761d5

View file

@ -104,7 +104,11 @@ module.exports = merge(sharedConfig, {
];
const isBackendRoute = ({ pathname }) => {
return backendRoutes.some(pathname.startsWith);
if (pathname) {
return backendRoutes.some(pathname.startsWith);
} else {
return false;
}
};
return isBackendRoute(requestUrl) && requestUrl;