Skip to content

Commit

Permalink
Merge pull request #135 from kodadot/fix/opt-out-409
Browse files Browse the repository at this point in the history
  • Loading branch information
preschian authored Aug 9, 2023
2 parents 534c0e6 + 8f868ca commit ba891cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions image/src/utils/cloudflare-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ export async function uploadToCloudflareImages({

const uploadCfImage = await fetch(
`https://api.cloudflare.com/client/v4/accounts/${imageAccount}/images/v1`,
requestOptions
requestOptions,
);
const uploadStatus = uploadCfImage.status;

console.log('uploadStatus', uploadStatus);

// if image supported by cf-images or already exists, redirect to cf-images
if (uploadStatus === 200 || uploadStatus === 409) {
// if image supported by cf-images, redirect to cf-images
if (uploadStatus === 200) {
// return Response.redirect(`https://imagedelivery.net/${c.env.CF_IMAGE_ID}/${path}/public`, 302)
return `https://imagedelivery.net/${imageId}/${path}/public`;
}
Expand Down

0 comments on commit ba891cc

Please sign in to comment.