From 0975025a1ad5ac79e62d84792ef3db2be846e818 Mon Sep 17 00:00:00 2001 From: james-owen Date: Fri, 13 Dec 2024 10:58:12 -0500 Subject: [PATCH] force purge url to start with https --- src/utils/purge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/purge.js b/src/utils/purge.js index 2ea67a2..26d846c 100644 --- a/src/utils/purge.js +++ b/src/utils/purge.js @@ -9,7 +9,7 @@ const { FASTLY_API_URL } = require('./constants'); * @throws {Error} Throws an error if the request was not successful */ const purgeUnauthenticated = function (url) { - return fetch(url, { method: 'PURGE' }) + return fetch(url.replace(/^(https?:\/\/)?/, 'https://'), { method: 'PURGE' }) .then(res => res.json()) .then(res => { res.url = url;