mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix(sw) http auth
This commit is contained in:
parent
6cbdddcd61
commit
6e9acd781f
1 changed files with 4 additions and 3 deletions
|
|
@ -57,9 +57,10 @@ async function onInstall() {
|
|||
}
|
||||
|
||||
async function onFetch(event) {
|
||||
const url = event.request.url;
|
||||
const {request} = event;
|
||||
const {url} = request;
|
||||
const pathname = getPathName(url);
|
||||
const request = getRequest(pathname, event.request);
|
||||
const newRequest = getRequest(pathname, event.request);
|
||||
|
||||
const cache = await caches.open(NAME);
|
||||
const response = await cache.match(request);
|
||||
|
|
@ -67,7 +68,7 @@ async function onFetch(event) {
|
|||
if (!isDev && response)
|
||||
return response;
|
||||
|
||||
const [e, resp] = await tryToCatch(fetch, request.clone(), {
|
||||
const [e, resp] = await tryToCatch(fetch, newRequest, {
|
||||
credentials: 'same-origin'
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue