From e73f49ec791aa40c3a6611220a85b4b3dceff3c3 Mon Sep 17 00:00:00 2001 From: Greg Fodor Date: Mon, 30 Dec 2019 06:39:48 +0000 Subject: [PATCH] Fix us-east-1 case when generating bucket URL --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3e8b387..6b5f0a8 100644 --- a/index.js +++ b/index.js @@ -155,7 +155,12 @@ module.exports.convert = async function convert(event, context, callback) { return callback(null, { statusCode: 200, - body: JSON.stringify({ url: `https://${scratchBucketId}.s3-${scratchBucketRegion}.amazonaws.com/${destKey}` }), + body: JSON.stringify({ + url: + scratchBucketRegion === "us-east-1" + ? `https://${scratchBucketId}.s3.amazonaws.com/${destKey}` + : `https://${scratchBucketId}.s3-${scratchBucketRegion}.amazonaws.com/${destKey}` + }), isBase64Encoded: false }); };