Skip to content

Commit

Permalink
Merge pull request #3 from LavCorps/feature/add-endpoint-port
Browse files Browse the repository at this point in the history
add endpoint port
  • Loading branch information
FaeyUmbrea authored May 16, 2023
2 parents 0592153 + b86ec8c commit d21be4e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
"/" +
Expand Down Expand Up @@ -183,4 +189,4 @@ let S3Utilss = {
createS3URL: S3Utils.createS3URL
}

window.S3Utils = S3Utilss;
window.S3Utils = S3Utilss;

0 comments on commit d21be4e

Please sign in to comment.