mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix(sw) navigation error
This commit is contained in:
parent
adbfb95012
commit
c356bc76f4
1 changed files with 6 additions and 2 deletions
|
|
@ -6,6 +6,9 @@ const currify = require('currify/legacy');
|
|||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
const isGet = (a) => a.method === 'GET';
|
||||
const isBasic = (a) => a.type === 'basic';
|
||||
|
||||
const wait = currify((f, e) => e.waitUntil(f()));
|
||||
const respondWith = currify((f, e) => {
|
||||
const {request} = e;
|
||||
|
|
@ -18,6 +21,9 @@ const respondWith = currify((f, e) => {
|
|||
if (!isGet(request))
|
||||
return;
|
||||
|
||||
if (!isBasic(request))
|
||||
return;
|
||||
|
||||
if (/^\/api/.test(pathname))
|
||||
return;
|
||||
|
||||
|
|
@ -32,8 +38,6 @@ const getPathName = (url) => new URL(url).pathname;
|
|||
const date = codegen`module.exports = '"' + Date() + '"'`;
|
||||
const NAME = `cloudcmd: ${date}`;
|
||||
|
||||
const isGet = (a) => a.method === 'GET';
|
||||
|
||||
const createRequest = (a) => new Request(a, {
|
||||
credentials: 'same-origin'
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue