forked from FoundKeyGang/FoundKey
オブジェクトストレージのURLに拡張子を含めるように
This commit is contained in:
parent
a103032d94
commit
704e217dbb
1 changed files with 4 additions and 2 deletions
|
@ -37,8 +37,10 @@ async function save(path: string, name: string, type: string, hash: string, size
|
||||||
if (config.drive && config.drive.storage == 'minio') {
|
if (config.drive && config.drive.storage == 'minio') {
|
||||||
const minio = new Minio.Client(config.drive.config);
|
const minio = new Minio.Client(config.drive.config);
|
||||||
|
|
||||||
const key = `${config.drive.prefix}/${uuid.v4()}`;
|
const [ext] = (name.match(/\.([a-zA-Z0-9_-]+)$/) || ['']);
|
||||||
const thumbnailKey = `${config.drive.prefix}/${uuid.v4()}`;
|
|
||||||
|
const key = `${config.drive.prefix}/${uuid.v4()}${ext}`;
|
||||||
|
const thumbnailKey = `${config.drive.prefix}/${uuid.v4()}.jpg`;
|
||||||
|
|
||||||
const baseUrl = config.drive.baseUrl
|
const baseUrl = config.drive.baseUrl
|
||||||
|| `${ config.drive.config.useSSL ? 'https' : 'http' }://${ config.drive.config.endPoint }${ config.drive.config.port ? `:${config.drive.config.port}` : '' }/${ config.drive.bucket }`;
|
|| `${ config.drive.config.useSSL ? 'https' : 'http' }://${ config.drive.config.endPoint }${ config.drive.config.port ? `:${config.drive.config.port}` : '' }/${ config.drive.bucket }`;
|
||||||
|
|
Loading…
Reference in a new issue