Skip to content

Commit

Permalink
$mol_service_worker minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Nov 5, 2024
1 parent b13f25e commit 6715f91
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions offline/offline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace $ {
if (cache === 'reload' || ( cache === 'no-cache' && ! html ) ) {
if (cache === 'reload') {
// F5 + Disable cache
request = this.request_clone(request, { cache: 'no-cache' })
request = new ($mol_wire_sync(Request))(request, { cache: 'no-cache' })
}

// fetch with fallback to cache if statuses not match
Expand All @@ -49,7 +49,7 @@ namespace $ {
}

if (cache !== 'force-cache') {
request = this.request_clone(request, { cache: 'force-cache' })
request = new ($mol_wire_sync(Request))(request, { cache: 'force-cache' })
}

const cached = this.$.$mol_fetch.response(request)
Expand Down
4 changes: 0 additions & 4 deletions service/plugin/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ namespace $ {
static blocked(request: Request) { return false }
static need_modify(request: Request) { return false }
static modify(request: Request) { return new Response }
@ $mol_action
protected static request_clone(original: Request, options?: RequestInit) {
return new Request(original, options)
}
}

export class $mol_service_plugin_notify extends $mol_service_plugin_base {
Expand Down
2 changes: 1 addition & 1 deletion service/worker/worker.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ namespace $ {

return $mol_wire_async(plugin).modify(event.request)
.catch(error => {
this.plugin_error(error, `${plugin}.need_modify()`)
this.plugin_error(error, `${plugin}.modify()`)
throw error
})
} catch (error) {
Expand Down

0 comments on commit 6715f91

Please sign in to comment.