diff --git a/scripts/module.js b/scripts/module.js index a5eb52d..3c96f44 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -156,6 +156,12 @@ class S3Utils { game.data.files.s3.endpoint.protocol + "//" + game.data.files.s3.endpoint.hostname + + ((game.data.files.s3.endpoint.port === 80) ? "" : ((game.data.files.s3.endpoint.port === 443) ? "" : ":" + game.data.files.s3.endpoint.port)) + + /* Add port number only if endpoint port isn't 80 or 443. + Tested & verified to work on an endpoint port that ISN'T 80 or 443, + but unsure how this logic holds up if given an endpoint URI without port. + Also unsure if AWS SDK assumes the port in the endpoint object based on protocol. + TL;DR Needs testing. */ "/" + bucket + "/" + @@ -183,4 +189,4 @@ let S3Utilss = { createS3URL: S3Utils.createS3URL } -window.S3Utils = S3Utilss; \ No newline at end of file +window.S3Utils = S3Utilss;