summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2019-04-06 17:50:22 +0200
committerGitHub2019-04-06 17:50:22 +0200
commit5379d65edc8edfb6135f43e4e021ee2d7907d957 (patch)
tree9f953eede02fe0d6d41553a9927af7ca61c48b93 /lib
parentee725dc58c89f1d9662f14a791a34cc93e2409ff (diff)
parent022c7ad61640f15bd436ed7b868fa2e305175ede (diff)
Merge pull request #31 from codimd/hidePortMinio
Hide port minio
Diffstat (limited to '')
-rw-r--r--lib/web/imageRouter/minio.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/web/imageRouter/minio.js b/lib/web/imageRouter/minio.js
index b921c2d2..1d993a45 100644
--- a/lib/web/imageRouter/minio.js
+++ b/lib/web/imageRouter/minio.js
@@ -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}`)
})
})
}