From 23d768f66df5922fba662b747b2571516de2fe9c Mon Sep 17 00:00:00 2001 From: Samantha Divina Date: Mon, 15 May 2023 06:54:45 -0600 Subject: [PATCH 1/3] Update module.js --- scripts/module.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/module.js b/scripts/module.js index a5eb52d..4eb9675 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -32,6 +32,7 @@ class S3Utils { if(game.settings.get(this.ID, this.SETTINGS.CUSTOM_STYLE)){ game.data.files.s3.endpoint.hostname = game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); + game.data.files.s3.endpoint.port = game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); game.data.files.s3.endpoint.host = game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); game.data.files.s3.endpoint.href = game.data.files.s3.endpoint.protocol + "//" + game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); } @@ -156,6 +157,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 +190,4 @@ let S3Utilss = { createS3URL: S3Utils.createS3URL } -window.S3Utils = S3Utilss; \ No newline at end of file +window.S3Utils = S3Utilss; From 2660debf5b37a9c77e87a552170bfeac609a773c Mon Sep 17 00:00:00 2001 From: Samantha Divina Date: Mon, 15 May 2023 06:56:45 -0600 Subject: [PATCH 2/3] Update module.js --- scripts/module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/module.js b/scripts/module.js index 4eb9675..3642d70 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -32,7 +32,7 @@ class S3Utils { if(game.settings.get(this.ID, this.SETTINGS.CUSTOM_STYLE)){ game.data.files.s3.endpoint.hostname = game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); - game.data.files.s3.endpoint.port = game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); + game.data.files.s3.endpoint.port = game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); // No idea what this does, truth be told. game.data.files.s3.endpoint.host = game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); game.data.files.s3.endpoint.href = game.data.files.s3.endpoint.protocol + "//" + game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); } From b86ec8cb9c71ad377e438ea9a7daea7c08afd7c2 Mon Sep 17 00:00:00 2001 From: Faey <1144986+FaeyUmbrea@users.noreply.github.com> Date: Tue, 16 May 2023 05:35:19 +0200 Subject: [PATCH 3/3] Update scripts/module.js --- scripts/module.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/module.js b/scripts/module.js index 3642d70..3c96f44 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -32,7 +32,6 @@ class S3Utils { if(game.settings.get(this.ID, this.SETTINGS.CUSTOM_STYLE)){ game.data.files.s3.endpoint.hostname = game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); - game.data.files.s3.endpoint.port = game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); // No idea what this does, truth be told. game.data.files.s3.endpoint.host = game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); game.data.files.s3.endpoint.href = game.data.files.s3.endpoint.protocol + "//" + game.settings.get(this.ID, this.SETTINGS.CUSTOM_PREFIX); }