diff --git a/functions/images/[[catchall]].js b/functions/images/[[catchall]].js index befddee..b79269c 100644 --- a/functions/images/[[catchall]].js +++ b/functions/images/[[catchall]].js @@ -1,12 +1,12 @@ -export async function onRequestGet(context) { - // const {pathname} = new URL(context.request.url) - // const imageURL = new URL(pathname, 'https://mdleom.com') - // const imageRequest = new Request(imageURL, { - // headers: context.request.headers - // }) +export async function onRequestGet (context) { + const { pathname } = new URL(context.request.url) + const imageURL = new URL(pathname, 'https://mdleom.com') + const imageRequest = new Request(imageURL, { + headers: context.request.headers + }) // return fetch(imageRequest) // CF_IMAGES binds to cf-images worker // configured in the pages dashboard - return context.env.CF_IMAGES.fetch(context.request) + return context.env.CF_IMAGES.fetch(imageRequest) }