Allow text/html cache display on offline page

This commit is contained in:
Brandon Rozek 2024-10-19 21:53:25 -04:00
parent 5f0441e629
commit 05e5786a80
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480
2 changed files with 2 additions and 2 deletions

View file

@ -46,7 +46,7 @@ async function listPages() {
if (url.includes('/blog')) { if (url.includes('/blog')) {
console.log(url) console.log(url)
const post = await cache.match(request); const post = await cache.match(request);
if (post.headers.get('content-type') === 'text/html') { if (post.headers.get('content-type').includes('text/html')) {
const body = await post.text(); const body = await post.text();
console.log(body) console.log(body)
const title = body.match(/<title>(.*)<\/title>/)[1]; const title = body.match(/<title>(.*)<\/title>/)[1];

@ -1 +1 @@
Subproject commit be3e20feb6562044b0b6559810d4482bf90f9ef2 Subproject commit 55a8368001d86661596f3deda3a7dc291ae864d6