Skip to content
Snippets Groups Projects
Commit 51a2c2f1 authored by Michał "rysiek" Woźniak's avatar Michał "rysiek" Woźniak :lock:
Browse files

WIP #71: cache self.log() bugfix

parent 2f047a0b
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@
* getting content from cache
*/
let getContentFromCache = (url) => {
self.log(config.name, 'getting from cache!')
self.log(config.name, `getting from cache: ${url}`)
return caches.open('v1')
.then((cache) => {
return cache.match(url)
......@@ -32,13 +32,11 @@
if (typeof response === 'undefined') {
throw new Error('Resource not found in cache');
} else {
self.log(
config.name,
'retrieved cached headers:\n',
response.headers.map((v, k)=>{
return `${k} : ${v}`
}).join('\n+-- ')
)
var msg = 'retrieved cached headers:'
response.headers.forEach((v, k)=>{
msg += `\n+-- ${k} : ${v}`
})
self.log(config.name, msg)
// return the response
return response
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment