From 9a71cca889ae0e7b3e5ab3999bca4f3492de3d9b Mon Sep 17 00:00:00 2001 From: Ike Saunders Date: Wed, 11 Dec 2024 09:14:20 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20use=20guid=20for=20cloudflare=20?= =?UTF-8?q?image=20uploads?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteServer/imagesHelpers.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/adminSiteServer/imagesHelpers.ts b/adminSiteServer/imagesHelpers.ts index d2e90bea7e6..786ba51e5f9 100644 --- a/adminSiteServer/imagesHelpers.ts +++ b/adminSiteServer/imagesHelpers.ts @@ -60,7 +60,6 @@ export async function processImageContent( export async function uploadToCloudflare(filename: string, blob: Blob) { const body = new FormData() body.append("file", blob, filename) - body.append("id", encodeURIComponent(filename)) body.append("metadata", JSON.stringify({ filename })) body.append("requireSignedURLs", "false") @@ -91,9 +90,9 @@ export async function uploadToCloudflare(filename: string, blob: Blob) { export async function deleteFromCloudflare(cloudflareId: string) { const response = await fetch( - `https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_IMAGES_ACCOUNT_ID}/images/v1/${encodeURIComponent( + `https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_IMAGES_ACCOUNT_ID}/images/v1/${ cloudflareId - )}`, + }`, { method: "DELETE", headers: {