mirror of https://github.com/status-im/codimd.git
Hide port from minio URL for protocol default port
Signed-off-by: Thor77 <thor77@thor77.org>
This commit is contained in:
parent
7f0fe6903c
commit
e928893cfe
|
@ -40,7 +40,9 @@ exports.uploadImage = function (imagePath, callback) {
|
|||
callback(new Error(err), null)
|
||||
return
|
||||
}
|
||||
callback(null, `${protocol}://${config.minio.endPoint}:${config.minio.port}/${config.s3bucket}/${key}`)
|
||||
let hidePort = (protocol === 'http' && config.minio.port === 80) || (protocol === 'https' && config.minio.port === 443)
|
||||
let urlPort = hidePort ? '' : `:${config.minio.port}`
|
||||
callback(null, `${protocol}://${config.minio.endPoint}${urlPort}/${config.s3bucket}/${key}`)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue