From 87ba625d46f55a063cc91bc87bab4eae48dd5744 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Wed, 12 Dec 2018 12:47:07 +0100 Subject: [PATCH] Remove checks for protocol before removing port Signed-off-by: Thor77 --- lib/web/imageRouter/minio.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/imageRouter/minio.js b/lib/web/imageRouter/minio.js index 1085a727..1d993a45 100644 --- a/lib/web/imageRouter/minio.js +++ b/lib/web/imageRouter/minio.js @@ -40,7 +40,7 @@ exports.uploadImage = function (imagePath, callback) { callback(new Error(err), null) return } - let hidePort = (protocol === 'http' && config.minio.port === 80) || (protocol === 'https' && config.minio.port === 443) + let hidePort = [80, 443].includes(config.minio.port) let urlPort = hidePort ? '' : `:${config.minio.port}` callback(null, `${protocol}://${config.minio.endPoint}${urlPort}/${config.s3bucket}/${key}`) })