diff --git a/cf-images/index.js b/cf-images/index.js index d071bca..f4bbf8b 100644 --- a/cf-images/index.js +++ b/cf-images/index.js @@ -102,7 +102,7 @@ export default { const { status, statusText } = response const htmlHeader = new Headers({ - ...request.headers, + ...Object.fromEntries(request.headers), Accept: 'text/html' }) const page404 = new Request('https://mdleom.com/404', { diff --git a/functions/images/[[catchall]].js b/functions/images/[[catchall]].js index 7069269..5c5275e 100644 --- a/functions/images/[[catchall]].js +++ b/functions/images/[[catchall]].js @@ -2,7 +2,7 @@ export async function onRequestGet (context) { const { pathname } = new URL(context.request.url) const imageURL = new URL(pathname, 'https://mdleom.com') const headers = new Headers({ - ...context.request.headers, + ...Object.fromEntries(context.request.headers), 'Host': 'mdleom.com' }) const imageRequest = new Request(imageURL, {