From 52a5eb3f1ac48eba71d01d03fbc94da05745e561 Mon Sep 17 00:00:00 2001 From: "Jakub T. Jankiewicz" Date: Tue, 23 Jan 2024 00:15:55 +0100 Subject: [PATCH] Fix wrong PURGE URL #1 --- src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.ts b/src/index.ts index 9ae7635..c5846bd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,6 +15,9 @@ async function purge(url: string) { const img = images[i] const cacheURL = img.attribs.src const rawURL = img.attribs['data-canonical-src'] + if (!rawURL) { + continue; + } // eslint-disable-next-line no-await-in-loop const res = await fetch(cacheURL, { method: 'PURGE' }) if (res.ok) {