From ab9329361be779525bf82ea55353080e5cd51962 Mon Sep 17 00:00:00 2001 From: endomorphosis Date: Tue, 20 Aug 2024 23:37:12 -0700 Subject: [PATCH] refactor: Update s3Kit constructor to conditionally update S3 configuration --- ipfs_model_manager_js/s3_kit.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ipfs_model_manager_js/s3_kit.js b/ipfs_model_manager_js/s3_kit.js index 2a03a28..bd3803a 100644 --- a/ipfs_model_manager_js/s3_kit.js +++ b/ipfs_model_manager_js/s3_kit.js @@ -51,12 +51,14 @@ export class s3Kit { } } this.s3 = new AWS.S3(this.s3cfg); - this.s3.config.update({ - accessKeyId: this.s3cfg.accessKey, - secretAccessKey: this.s3cfg.secretKey, - endpoint: this.s3cfg.endpoint, - s3ForcePathStyle: true - }); + if (this.s3cfg) { + this.s3.config.update({ + accessKeyId: this.s3cfg.accessKey, + secretAccessKey: this.s3cfg.secretKey, + endpoint: this.s3cfg.endpoint, + s3ForcePathStyle: true + }); + } } call(method, kwargs) {