From f13f318b9819db0d5df4a2c0446091292df3a19e Mon Sep 17 00:00:00 2001 From: Lindsay Levine Date: Tue, 26 Jan 2021 06:04:01 -0500 Subject: [PATCH] fix image url in imageFunction --- 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);