Remove checks for protocol before removing port

Signed-off-by: Thor77 <thor77@thor77.org>
This commit is contained in:
Thor77 2018-12-12 12:47:07 +01:00
parent e928893cfe
commit 87ba625d46
1 changed files with 1 additions and 1 deletions

View File

@ -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}`)
})