From 200eee2381789d2d9bd68d65874ee220ba7fc2e9 Mon Sep 17 00:00:00 2001 From: lindsaylevine <57350178+lindsaylevine@users.noreply.github.com> Date: Wed, 27 Jan 2021 03:57:36 -0800 Subject: [PATCH] fix image url in imageFunction (#159) --- lib/templates/imageFunction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/templates/imageFunction.js b/lib/templates/imageFunction.js index 9e74447..60b84c4 100644 --- a/lib/templates/imageFunction.js +++ b/lib/templates/imageFunction.js @@ -7,7 +7,7 @@ exports.handler = async (event) => { const quality = parseInt(q); const imageUrl = url.startsWith("/") - ? `${process.env.URL || "http://localhost:8888"}${url}` + ? `${process.env.DEPLOY_URL || `http://${event.headers.host}`}${url}` : url; const image = await jimp.read(imageUrl);