Skip to content

Commit

Permalink
Merge pull request #31 from codimd/hidePortMinio
Browse files Browse the repository at this point in the history
Hide port minio
  • Loading branch information
SISheogorath committed Apr 6, 2019
2 parents ee725dc + 022c7ad commit 5379d65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/web/imageRouter/minio.js
Expand Up @@ -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 = [80, 443].includes(config.minio.port)
let urlPort = hidePort ? '' : `:${config.minio.port}`
callback(null, `${protocol}://${config.minio.endPoint}${urlPort}/${config.s3bucket}/${key}`)
})
})
}

0 comments on commit 5379d65

Please sign in to comment.